예제 #1
0
        public void LoadData(int testCasePriorityId, bool showId)
        {
            Clear();

            var data = new TestCasePriorityDataModel();

            data.TestCasePriorityId = testCasePriorityId;

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

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

            var item = items[0];

            SetData(item);

            if (!showId)
            {
                SystemKeyId = item.TestCasePriorityId;
                oHistoryList.Setup(PrimaryEntity, testCasePriorityId, PrimaryEntityKey);
            }
            else
            {
                CoreSystemKey.Text = String.Empty;
            }
        }
예제 #2
0
        public void SetData(TestCasePriorityDataModel data)
        {
            SystemKeyId = data.TestCasePriorityId;


            base.SetData(data);
        }
예제 #3
0
        public override int?Save(string action)
        {
            var data = new TestCasePriorityDataModel();

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

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

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

            return(data.TestCasePriorityId);
        }
예제 #4
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new TestCasePriorityDataModel();

            UpdatedData = TestCaseManagement.Components.DataAccess.TestCasePriorityDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.TestCasePriorityId =
                    Convert.ToInt32(SelectedData.Rows[i][TestCasePriorityDataModel.DataColumns.TestCasePriorityId].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.TestCasePriorityDataManager.Update(data, SessionVariables.RequestProfile);
                data = new TestCasePriorityDataModel();
                data.TestCasePriorityId = Convert.ToInt32(SelectedData.Rows[i][TestCasePriorityDataModel.DataColumns.TestCasePriorityId].ToString());
                var dt = TestCaseManagement.Components.DataAccess.TestCasePriorityDataManager.Search(data, SessionVariables.RequestProfile);

                if (dt.Rows.Count == 1)
                {
                    UpdatedData.ImportRow(dt.Rows[0]);
                }
            }
            return(UpdatedData);
        }
예제 #5
0
        protected override void ShowData(int testCasePriorityId)
        {
            base.ShowData(testCasePriorityId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new TestCasePriorityDataModel();

            data.TestCasePriorityId = testCasePriorityId;

            var items = TestCasePriorityDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

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

                lblTestCasePriorityId.Text = item.TestCasePriorityId.ToString();

                SetData(item);

                oHistoryList.Setup(PrimaryEntity, testCasePriorityId, "TestCasePriority");
            }
        }
예제 #6
0
        public static string Save(TestCasePriorityDataModel data, string action, RequestProfile requestProfile)
        {
            var sql = "EXEC ";

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

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

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

            return(sql);
        }
예제 #7
0
        public static int Create(TestCasePriorityDataModel data, RequestProfile requestProfile)
        {
            var sql   = Save(data, "Create", requestProfile);
            var newId = DBDML.RunScalarSQL("TestCasePriority.Insert", sql, DataStoreKey);

            return(Convert.ToInt32(newId));
        }
예제 #8
0
        protected override void Clear()
        {
            base.Clear();

            var data = new TestCasePriorityDataModel();

            SetData(data);
        }
예제 #9
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new TestCasePriorityDataModel();

            PropertyMapper.CopyProperties(data, values);

            TestCaseManagement.Components.DataAccess.TestCasePriorityDataManager.Update(data, SessionVariables.RequestProfile);
            base.Update(values);
        }
예제 #10
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var testCasePrioritydata = new TestCasePriorityDataModel();

            testCasePrioritydata.TestCasePriorityId = entityKey;
            var results = TestCaseManagement.Components.DataAccess.TestCasePriorityDataManager.Search(testCasePrioritydata, SessionVariables.RequestProfile);

            return(results);
        }
예제 #11
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new TestCasePriorityDataModel();

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

            return(dt);
        }
예제 #12
0
        public static DataSet GetChildren(TestCasePriorityDataModel data, RequestProfile requestProfile)
        {
            var sql = "EXEC dbo.TestCasePriorityChildrenGet" +
                      " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                      ", " + ToSQLParameter(data, TestCasePriorityDataModel.DataColumns.TestCasePriorityId);
            var oDT = new Framework.Components.DataAccess.DBDataSet("Get Children", sql, DataStoreKey);

            return(oDT.DBDataset);
        }
예제 #13
0
        public static bool DoesExist(TestCasePriorityDataModel data, RequestProfile requestProfile)
        {
            var doesExistRequest = new TestCasePriorityDataModel();

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

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

            return(list.Count > 0);
        }
예제 #14
0
        private void UpdateData(ArrayList values)
        {
            var data = new TestCasePriorityDataModel();

            data.TestCasePriorityId = 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.TestCasePriorityDataManager.Update(data, SessionVariables.RequestProfile);
            ReBindEditableGrid();
        }
예제 #15
0
        public static void Delete(TestCasePriorityDataModel data, RequestProfile requestProfile)
        {
            const string sql = @"dbo.TestCasePriorityDelete ";

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

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure);
            }
        }
예제 #16
0
        public static bool IsDeletable(TestCasePriorityDataModel 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);
        }
예제 #17
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string[] deleteIndexList = DeleteIds.Split(',');
         foreach (string index in deleteIndexList)
         {
             var data = new TestCasePriorityDataModel();
             data.TestCasePriorityId = int.Parse(index);
             TestCaseManagement.Components.DataAccess.TestCasePriorityDataManager.Delete(data, SessionVariables.RequestProfile);
             DeleteAndRedirect();
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
예제 #18
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows         = new DataTable();
                var testCasePrioritydata = new TestCasePriorityDataModel();

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

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

            return(null);
        }
예제 #19
0
        public static List <TestCasePriorityDataModel> GetEntityDetails(TestCasePriorityDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails)
        {
            const string sql = @"dbo.TestCasePrioritySearch ";

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

            List <TestCasePriorityDataModel> result;

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

            return(result);
        }
예제 #20
0
        public static string ToSQLParameter(TestCasePriorityDataModel data, string dataColumnName)
        {
            var returnValue = "NULL";

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

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

            return(returnValue);
        }
예제 #21
0
        public static DataTable Search(TestCasePriorityDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 0);

            return(list.ToDataTable());
        }
예제 #22
0
        public static void Update(TestCasePriorityDataModel data, RequestProfile requestProfile)
        {
            var sql = Save(data, "Update", requestProfile);

            DBDML.RunSQL("TestCasePriority.Update", sql, DataStoreKey);
        }
예제 #23
0
 private void ReBindEditableGrid()
 {
     var data = new TestCasePriorityDataModel();
     var dtTestCasePriority = TestCaseManagement.Components.DataAccess.TestCasePriorityDataManager.Search(data, SessionVariables.RequestProfile);
 }
예제 #24
0
        public static TestCasePriorityDataModel GetDetails(TestCasePriorityDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 1);

            return(list.FirstOrDefault());
        }