protected void BtnEdit_Click(object sender, EventArgs e)
        {
            int lintCnt = 0;

            try
            {
                EntityTestMethod entTest = new EntityTestMethod();
                entTest.TestMethodId = Convert.ToInt32(txtTestMethodId.Text);

                entTest.TestMethodDesc = txtTestMethodDesc.Text;

                lintCnt = mobjTestBLL.UpdateTestMethod(entTest);

                if (lintCnt > 0)
                {
                    GetTests();
                    lblMessage.Text = "Record Updated Successfully";
                    //this.programmaticModalPopup.Hide();
                }
                else
                {
                    lblMessage.Text = "Record Not Updated";
                }
                MultiView1.SetActiveView(View1);
            }
            catch (Exception ex)
            {
                Commons.FileLog("frmTestMethodMaster -  BtnEdit_Click(object sender, EventArgs e)", ex);
            }
        }
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            int lintcnt = 0;
            EntityTestMethod entTest = new EntityTestMethod();

            if (string.IsNullOrEmpty(txtTestMethodDesc.Text.Trim()))
            {
                lblMsg.Text = "Please Enter Test Method Description";
            }
            else
            {
                entTest.TestMethodId   = Convert.ToInt32(txtTestMethodId.Text);
                entTest.TestMethodDesc = txtTestMethodDesc.Text.Trim();
                lintcnt = mobjTestBLL.InsertTestMethod(entTest);
                if (lintcnt > 0)
                {
                    GetTests();
                    lblMessage.Text = "Record Inserted Successfully";
                    //this.programmaticModalPopup.Hide();
                }
                else
                {
                    lblMessage.Text = "Record Not Inserted";
                }
            }

            MultiView1.SetActiveView(View1);
        }
        protected void BtnAddNewTestMethod_Click(object sender, EventArgs e)
        {
            EntityTestMethod entTest = new EntityTestMethod();
            int ID = mobjTestBLL.GetNewTestMethodId();

            txtTestMethodId.Text   = Convert.ToString(ID);
            txtTestMethodDesc.Text = string.Empty;

            btnUpdate.Visible = false;
            BtnSave.Visible   = true;
            MultiView1.SetActiveView(View2);
        }
Ejemplo n.º 4
0
 public int DeleteTestMethod(EntityTestMethod entTest)
 {
     int cnt = 0;
     try
     {
         List<SqlParameter> lstParam = new List<SqlParameter>();
         Commons.ADDParameter(ref lstParam, "@TestMethodId", DbType.String, entTest.TestMethodId);
         cnt = mobjDataAcces.ExecuteQuery("sp_DeleteTestMethod", lstParam);
     }
     catch (Exception ex)
     {
         Commons.FileLog("TestMethodBLL - DeleteTestMethod(EntityTestMethod entTest)", ex);
     }
     return cnt;
 }
Ejemplo n.º 5
0
        public int InsertTestMethod(EntityTestMethod entTest)
        {
            try
            {
                tblTestMethod obj = new tblTestMethod()
                {
                    TestMethodName = entTest.TestMethodDesc,
                    IsDelete = false

                };
                objData.tblTestMethods.InsertOnSubmit(obj);
                objData.SubmitChanges();
                return 1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 6
0
        public int GetNewTestMethodId()
        {
            EntityTestMethod ldt = new EntityTestMethod();
            try
            {
                ldt = (from tbl in objData.tblTestMethods
                       where tbl.IsDelete == false
                       orderby tbl.TestMethodId descending
                       select new EntityTestMethod { TestMethodId = (tbl.TestMethodId + 1) }).FirstOrDefault();
            }
            catch (Exception ex)
            {

                Commons.FileLog("TestMethodBLL - GetNewTestMethodId()", ex);
            }
            if (ldt != null)
            {
                return ldt.TestMethodId;
            }
            else
            {
                return 1;
            }
        }