Ejemplo n.º 1
0
        //public static List<FeatureRuleDataModel> GetEntityDetails(FeatureRuleDataModel data, int auditId)
        //{
        //    var sql = "EXEC dbo.FeatureRuleSearch " +
        //              " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, auditId) +
        //               ", " + ToSQLParameter(data, FeatureRuleDataModel.DataColumns.FeatureRuleId);

        //    var result = new List<FeatureRuleDataModel>();

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

        //        while (dbReader.Read())
        //        {
        //            var dataItem = new FeatureRuleDataModel();

        //            dataItem.FeatureRuleId = (int)dbReader[FeatureRuleDataModel.DataColumns.FeatureRuleId];
        //            dataItem.FeatureRuleCategoryId = (int)dbReader[FeatureRuleDataModel.DataColumns.FeatureRuleCategoryId];

        //            SetStandardInfo(dataItem, dbReader);

        //            SetBaseInfo(dataItem, dbReader);

        //            result.Add(dataItem);
        //        }
        //    }

        //    return result;
        //}

        #endregion GetDetails

        #region CreateOrUpdate
        private static string CreateOrUpdate(FeatureRuleDataModel data, RequestProfile requestProfile, string action)
        {
            var traceId = TraceDataManager.GetNextTraceId(requestProfile);
            var sql     = "EXEC ";

            switch (action)
            {
            case "Create":
                sql += "dbo.FeatureRuleInsert  " + "\r\n" +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                       ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, requestProfile.ApplicationId);
                break;

            case "Update":
                sql += "dbo.FeatureRuleUpdate  " + "\r\n" +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId);

                break;

            default:
                break;
            }

            sql = sql + ", " + ToSQLParameter(data, FeatureRuleDataModel.DataColumns.FeatureRuleId) +
                  ", " + ToSQLParameter(data, FeatureRuleDataModel.DataColumns.FeatureRuleCategoryId) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.Name) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.Description) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.SortOrder);

            return(sql);
        }
Ejemplo n.º 2
0
        private static string CreateOrUpdate(ProjectPortfolioGroupXProjectPortfolioDataModel data, RequestProfile requestProfile, string sqlcmd)
        {
            var traceId = TraceDataManager.GetNextTraceId(requestProfile);
            var sql     = "EXEC ";

            switch (sqlcmd)
            {
            case "Create":
                sql += "dbo.ProjectPortfolioGroupXProjectPortfolioInsert  " + "\r\n" +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                       ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.TraceId, traceId) +
                       ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, requestProfile.ApplicationId);
                break;

            case "Update":
                sql += "dbo.ProjectPortfolioGroupXProjectPortfolioUpdate  " + "\r\n" +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                       ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.TraceId, traceId);
                break;

            default:
                break;
            }

            sql = sql + ", " + ToSQLParameter(data, ProjectPortfolioGroupXProjectPortfolioDataModel.DataColumns.ProjectPortfolioGroupXProjectPortfolioId) +
                  ", " + ToSQLParameter(data, ProjectPortfolioGroupXProjectPortfolioDataModel.DataColumns.ProjectPortfolioGroupId) +
                  ", " + ToSQLParameter(data, ProjectPortfolioGroupXProjectPortfolioDataModel.DataColumns.ProjectPortfolioId) +
                  ", " + ToSQLParameter(data, ProjectPortfolioGroupXProjectPortfolioDataModel.DataColumns.Description) +
                  ", " + ToSQLParameter(data, ProjectPortfolioGroupXProjectPortfolioDataModel.DataColumns.SortOrder);
            return(sql);
        }