Esempio n. 1
0
        private static string Save(DomainModel.FieldConfigurationModeAccessMode data, int auditId, string sqlcmd)
        {
            var sql = "EXEC ";

            switch (sqlcmd)
            {
            case "Create":
                sql += "dbo.FieldConfigurationModeAccessModeInsert  " +
                       " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                       ", " + ToSQLParameter(BaseModel.BaseDataColumns.ApplicationId, ApplicationId);
                break;

            case "Update":
                sql += "dbo.FieldConfigurationModeAccessModeUpdate  " +
                       " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                       ", " + ToSQLParameter(BaseModel.BaseDataColumns.ApplicationId, ApplicationId);
                break;

            default:
                break;
            }

            sql = sql + ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Name) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Description) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.SortOrder);
            return(sql);
        }
Esempio n. 2
0
        public static List <DomainModel.FieldConfigurationModeAccessMode> GetEntityDetails(DomainModel.FieldConfigurationModeAccessMode data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeAccessModeDetails " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId);

            var result = new List <DomainModel.FieldConfigurationModeAccessMode>();

            using (var reader = new DBDataReader("Get Details", sql, DataStoreKey))
            {
                var dbReader = reader.DBReader;

                while (dbReader.Read())
                {
                    var dataItem = new DomainModel.FieldConfigurationModeAccessMode();

                    dataItem.FieldConfigurationModeAccessModeId = (int)dbReader[DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId];

                    SetStandardInfo(dataItem, dbReader);

                    //SetBaseInfo(dataItem, dbReader);
                    result.Add(dataItem);
                }
            }

            return(result);
        }
Esempio n. 3
0
        public static void Delete(DomainModel.FieldConfigurationModeAccessMode data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeAccessModeDelete " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId);

            DataAccess.DBDML.RunSQL("FieldConfigurationModeAccessMode.Delete", sql, DataStoreKey);
        }
Esempio n. 4
0
        public static DataTable GetDetails(DomainModel.FieldConfigurationModeAccessMode data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeAccessModeDetails " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId);

            var oDT = new DataAccess.DBDataTable("FieldConfigurationModeAccessMode.Details", sql, DataStoreKey);

            return(oDT.DBTable);
        }
Esempio n. 5
0
        private static DataSet GetChildren(DomainModel.FieldConfigurationModeAccessMode data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeXApplicationRoleChildrenGet " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId);

            var oDT = new Framework.Components.DataAccess.DBDataSet("Get Children", sql, DataStoreKey);

            return(oDT.DBDataset);
        }
Esempio n. 6
0
        public static DataTable DoesExist(DomainModel.FieldConfigurationModeAccessMode data, int auditId)
        {
            var sql = "EXEC dbo.FieldConfigurationModeAccessModeDoesExist " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(BaseModel.BaseDataColumns.ApplicationId, ApplicationId) +
                      ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Name);

            var oDT = new DataAccess.DBDataTable("FieldConfigurationModeAccessMode.DoesExist", sql, DataStoreKey);

            return(oDT.DBTable);
        }
Esempio n. 7
0
        public static bool IsDeletable(DomainModel.FieldConfigurationModeAccessMode data, int auditId)
        {
            var isDeletable = true;
            var ds          = GetChildren(data, auditId);

            if (ds != null && ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        isDeletable = false;
                        break;
                    }
                }
            }
            return(isDeletable);
        }
Esempio n. 8
0
        public static string ToSQLParameter(DomainModel.FieldConfigurationModeAccessMode data, string dataColumnName)
        {
            var returnValue = "NULL";

            switch (dataColumnName)
            {
            case DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId:
                if (data.FieldConfigurationModeAccessModeId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId, data.FieldConfigurationModeAccessModeId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, DomainModel.FieldConfigurationModeAccessMode.DataColumns.FieldConfigurationModeAccessModeId);
                }
                break;

            default:
                returnValue = StandardClass.ToSQLParameter(data, dataColumnName);
                break;
            }

            return(returnValue);
        }
Esempio n. 9
0
        public static void Update(DomainModel.FieldConfigurationModeAccessMode data, int auditId)
        {
            var sql = Save(data, auditId, "Update");

            DataAccess.DBDML.RunSQL("FieldConfigurationModeAccessMode.Update", sql, DataStoreKey);
        }