using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Vrh.OneReport.Lib.Areas.OneReport.Models
{
///
/// Holds the list of a menu items for a user role.
///
public class UserRoleGroupModel
{
public enum ItemGroupState
{
Unknown,
Opened,
Closed
}
public string Name { get; set; }
public List Items { get; set; }
public ItemGroupState GroupState { get; set; }
}
///
/// Holds the query and report data needed for a menu item.
///
public class ItemDescriptor
{
public string Name { get; set; }
public string Controller { get; set; }
public string Action { get; set; }
public object Params { get; set; }
public string Description { get; set; }
}
///
/// Holds the data needed for a database command parameter.
///
public class CommandParameter
{
public static int CommandTimeout
{
get
{
string value = System.Web.Configuration.WebConfigurationManager.AppSettings.Get("SQLCommandTimeout");
int timeout;
return (string.IsNullOrEmpty(value) || !int.TryParse(value, out timeout) ? -1 : timeout);
}
}
///
/// Name of the parameter.
///
public string Name;
///
/// Type of the parameter.
///
public System.Data.DbType Type;
///
/// Value of the parameter.
///
public string Value;
public CommandParameter(string Name, System.Data.DbType Type, string Value)
{
this.Name = Name;
this.Type = Type;
this.Value = Value;
}
public static void SetCommandTimeout(System.Data.SqlClient.SqlCommand mySqlCommand)
{
int timeout;
if ((timeout = CommandTimeout) >= 0)
mySqlCommand.CommandTimeout = timeout;
}
public static void SetCommandTimeout(System.Data.Common.DbCommand dbCommand)
{
int timeout;
if ((timeout = CommandTimeout) >= 0)
dbCommand.CommandTimeout = timeout;
}
}
}