Example #1
0
        protected override void ShowData(int testCaseId)
        {
            base.ShowData(testCaseId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new TestCaseDataModel();

            data.TestCaseId = testCaseId;

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

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

                lblTestCaseId.Text  = item.TestCaseId.ToString();
                lblApplication.Text = item.ApplicationId.ToString();

                SetData(item);

                oHistoryList.Setup(PrimaryEntity, testCaseId, "TestCase");
            }
        }
Example #2
0
        public override int?Save(string action)
        {
            var data = new TestCaseDataModel();

            data.TestCaseId    = TestCaseId;
            data.ApplicationId = ApplicationId;
            data.Name          = Name;
            data.Description   = Description;
            data.SortOrder     = SortOrder;

            if (action == "Insert")
            {
                var dtTestCase = TestCaseDataManager.DoesExist(data, SessionVariables.RequestProfile);

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

            return(data.TestCaseId);
        }