コード例 #1
0
        public void LoadData(int testCaseStatusId, bool showId)
        {
            Clear();

            var data = new TestCaseStatusDataModel();

            data.TestCaseStatusId = testCaseStatusId;

            var items = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (items.Count != 1)
            {
                return;
            }

            var item = items[0];

            SetData(item);

            if (!showId)
            {
                SystemKeyId = item.TestCaseStatusId;
                oHistoryList.Setup(PrimaryEntity, testCaseStatusId, PrimaryEntityKey);
            }
            else
            {
                CoreSystemKey.Text = String.Empty;
            }
        }
コード例 #2
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new TestCaseStatusDataModel();

            UpdatedData = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.TestCaseStatusId =
                    Convert.ToInt32(SelectedData.Rows[i][TestCaseStatusDataModel.DataColumns.TestCaseStatusId].ToString());
                data.Name        = SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Name].ToString();
                data.Description =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description))
                    ? CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description)
                    : SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Description].ToString();

                data.SortOrder =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder))
                    ? int.Parse(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder).ToString())
                    : int.Parse(SelectedData.Rows[i][StandardDataModel.StandardDataColumns.SortOrder].ToString());

                TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Update(data, SessionVariables.RequestProfile);
                data = new TestCaseStatusDataModel();
                data.TestCaseStatusId = Convert.ToInt32(SelectedData.Rows[i][TestCaseStatusDataModel.DataColumns.TestCaseStatusId].ToString());
                var dt = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Search(data, SessionVariables.RequestProfile);
                if (dt.Rows.Count == 1)
                {
                    UpdatedData.ImportRow(dt.Rows[0]);
                }
            }
            return(UpdatedData);
        }
コード例 #3
0
        public static int Create(TestCaseStatusDataModel data, RequestProfile requestProfile)
        {
            var sql   = Save(data, "Create", requestProfile);
            var newId = DBDML.RunScalarSQL("TestCaseStatus.Insert", sql, DataStoreKey);

            return(Convert.ToInt32(newId));
        }
コード例 #4
0
        public static string Save(TestCaseStatusDataModel data, string action, RequestProfile requestProfile)
        {
            var sql = "EXEC ";

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

            case "Update":
                sql += "dbo.TestCaseStatusUpdate  " +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId);
                break;

            default:
                break;
            }
            sql = sql + ", " + ToSQLParameter(data, TestCaseStatusDataModel.DataColumns.TestCaseStatusId) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.Name) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.Description) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.SortOrder);

            return(sql);
        }
コード例 #5
0
        public override int?Save(string action)
        {
            var data = new TestCaseStatusDataModel();

            data.TestCaseStatusId = SystemKeyId;
            data.Name             = Name;
            data.Description      = Description;
            data.SortOrder        = SortOrder;

            if (action == "Insert")
            {
                var dtTestCaseStatus = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtTestCaseStatus.Rows.Count == 0)
                {
                    TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(data.TestCaseStatusId);
        }
コード例 #6
0
        protected override void Clear()
        {
            base.Clear();

            var data = new TestCaseStatusDataModel();

            SetData(data);
        }
コード例 #7
0
        public static DataSet GetChildren(TestCaseStatusDataModel data, RequestProfile requestProfile)
        {
            var sql = "EXEC dbo.TestCaseStatusChildrenGet" +
                      " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                      ", " + ToSQLParameter(data, TestCaseStatusDataModel.DataColumns.TestCaseStatusId);
            var oDT = new Framework.Components.DataAccess.DBDataSet("Get Children", sql, DataStoreKey);

            return(oDT.DBDataset);
        }
コード例 #8
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new TestCaseStatusDataModel();

            PropertyMapper.CopyProperties(data, values);

            TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Update(data, SessionVariables.RequestProfile);
            base.Update(values);
        }
コード例 #9
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var testCaseStatusdata = new TestCaseStatusDataModel();

            testCaseStatusdata.TestCaseStatusId = entityKey;
            var results = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Search(testCaseStatusdata, SessionVariables.RequestProfile);

            return(results);
        }
コード例 #10
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new TestCaseStatusDataModel();


            var dt = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
コード例 #11
0
        public static bool DoesExist(TestCaseStatusDataModel data, RequestProfile requestProfile)
        {
            var doesExistRequest = new TestCaseStatusDataModel();

            doesExistRequest.ApplicationId = data.ApplicationId;
            doesExistRequest.Name          = data.Name;

            var list = GetEntityDetails(doesExistRequest, requestProfile, 0);

            return(list.Count > 0);
        }
コード例 #12
0
        private void UpdateData(ArrayList values)
        {
            var data = new TestCaseStatusDataModel();

            data.TestCaseStatusId = int.Parse(values[0].ToString());
            data.Name             = values[1].ToString();
            data.Description      = values[2].ToString();
            data.SortOrder        = int.Parse(values[3].ToString());

            TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Update(data, SessionVariables.RequestProfile);
            ReBindEditableGrid();
        }
コード例 #13
0
        public static void Delete(TestCaseStatusDataModel data, RequestProfile requestProfile)
        {
            const string sql = @"dbo.TestCaseStatusDelete ";

            var parameters =
                new
            {
                AuditId            = requestProfile.AuditId
                , TestCaseStatusId = data.TestCaseStatusId
            };

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure);
            }
        }
コード例 #14
0
        public static bool IsDeletable(TestCaseStatusDataModel data, RequestProfile requestProfile)
        {
            var isDeletable = true;
            var ds          = GetChildren(data, requestProfile);

            if (ds != null && ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        isDeletable = false;
                        break;
                    }
                }
            }
            return(isDeletable);
        }
コード例 #15
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string[] deleteIndexList = DeleteIds.Split(',');
         foreach (string index in deleteIndexList)
         {
             var data = new TestCaseStatusDataModel();
             data.TestCaseStatusId = int.Parse(index);
             TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Delete(data, SessionVariables.RequestProfile);
             DeleteAndRedirect();
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
コード例 #16
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows       = new DataTable();
                var testCaseStatusdata = new TestCaseStatusDataModel();

                selectedrows = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.GetDetails(testCaseStatusdata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        testCaseStatusdata.TestCaseStatusId = entityKey;
                        var result = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.GetDetails(testCaseStatusdata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    testCaseStatusdata.TestCaseStatusId = SetId;
                    var result = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.GetDetails(testCaseStatusdata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

            return(null);
        }
コード例 #17
0
        protected override void ShowData(int testCaseStatusId)
        {
            base.ShowData(testCaseStatusId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new TestCaseStatusDataModel();

            data.TestCaseStatusId = testCaseStatusId;

            var items = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (items.Count == 1)
            {
                var item = items[0];

                SetData(item);

                oHistoryList.Setup(PrimaryEntity, testCaseStatusId, "TestCaseStatus");
            }
        }
コード例 #18
0
        public static List <TestCaseStatusDataModel> GetEntityDetails(TestCaseStatusDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails)
        {
            const string sql = @"dbo.TestCaseStatusSearch ";

            var parameters =
                new
            {
                AuditId            = requestProfile.AuditId
                , ApplicationId    = requestProfile.ApplicationId
                , ApplicationMode  = requestProfile.ApplicationModeId
                , ReturnAuditInfo  = returnAuditInfo
                , TestCaseStatusId = dataQuery.TestCaseStatusId
                , Name             = dataQuery.Name
            };

            List <TestCaseStatusDataModel> result;

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                result = dataAccess.Connection.Query <TestCaseStatusDataModel>(sql, parameters, commandType: CommandType.StoredProcedure).ToList();
            }

            return(result);
        }
コード例 #19
0
        public static string ToSQLParameter(TestCaseStatusDataModel data, string dataColumnName)
        {
            var returnValue = "NULL";

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

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

            return(returnValue);
        }
コード例 #20
0
        public static TestCaseStatusDataModel GetDetails(TestCaseStatusDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 1);

            return(list.FirstOrDefault());
        }
コード例 #21
0
 private void ReBindEditableGrid()
 {
     var data             = new TestCaseStatusDataModel();
     var dtTestCaseStatus = TestCaseManagement.Components.DataAccess.TestCaseStatusDataManager.Search(data, SessionVariables.RequestProfile);
 }
コード例 #22
0
        public static DataTable Search(TestCaseStatusDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 0);

            return(list.ToDataTable());
        }
コード例 #23
0
        public void SetData(TestCaseStatusDataModel item)
        {
            SystemKeyId = item.TestCaseStatusId;

            base.SetData(item);
        }
コード例 #24
0
        public static void Update(TestCaseStatusDataModel data, RequestProfile requestProfile)
        {
            var sql = Save(data, "Update", requestProfile);

            DBDML.RunSQL("TestCaseStatus.Update", sql, DataStoreKey);
        }
コード例 #25
0
        public void SetData(TestCaseStatusDataModel data)
        {
            SystemKeyId = data.TestCaseStatusId;

            base.SetData(data);
        }