Example #1
0
        public static List <DomainModel.DateRangeTitle> GetEntityDetails(DomainModel.DateRangeTitle data, int auditId)
        {
            var sql = "EXEC dbo.DateRangeTitleDetails " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.DateRangeTitle.DataColumns.DateRangeTitleId);

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

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

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

                    dataItem.DateRangeTitleId = (int)dbReader[DomainModel.DateRangeTitle.DataColumns.DateRangeTitleId];

                    SetStandardInfo(dataItem, dbReader);

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

            return(result);
        }
Example #2
0
        private static string Save(DomainModel.DateRangeTitle data, int auditId, string sqlcmd)
        {
            var sql = "EXEC ";

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

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

            default:
                break;
            }

            sql = sql + ", " + ToSQLParameter(data, DomainModel.DateRangeTitle.DataColumns.DateRangeTitleId) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Name) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Description) +
                  ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.SortOrder);
            return(sql);
        }
Example #3
0
        public static void Delete(DomainModel.DateRangeTitle data, int auditId)
        {
            var sql = "EXEC dbo.DateRangeTitleDelete " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.DateRangeTitle.DataColumns.DateRangeTitleId);

            DataAccess.DBDML.RunSQL("DateRangeTitle.Delete", sql, DataStoreKey);
        }
Example #4
0
        public static DataTable GetDetails(DomainModel.DateRangeTitle data, int auditId)
        {
            var sql = "EXEC dbo.DateRangeTitleDetails " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(data, DomainModel.DateRangeTitle.DataColumns.DateRangeTitleId);

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

            return(oDT.DBTable);
        }
Example #5
0
        public static DataTable DoesExist(DomainModel.DateRangeTitle data, int auditId)
        {
            var sql = "EXEC dbo.DateRangeTitleDoesExist " +
                      " " + ToSQLParameter(BaseModel.BaseDataColumns.AuditId, auditId) +
                      ", " + ToSQLParameter(BaseModel.BaseDataColumns.ApplicationId, ApplicationId) +
                      ", " + ToSQLParameter(data, StandardModel.StandardDataColumns.Name) +
                      ", " + ToSQLParameter(data, DomainModel.DateRangeTitle.DataColumns.DateRangeTitleId);

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

            return(oDT.DBTable);
        }
Example #6
0
        public static string ToSQLParameter(DomainModel.DateRangeTitle data, string dataColumnName)
        {
            var returnValue = "NULL";

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

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

            return(returnValue);
        }
Example #7
0
        public static void Create(DomainModel.DateRangeTitle data, int auditId)
        {
            var sql = Save(data, auditId, "Create");

            DataAccess.DBDML.RunSQL("DateRangeTitle.Insert", sql, DataStoreKey);
        }