예제 #1
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     lblError.Text   = "";
     lblSuccess.Text = "";
     try
     {
         if (txtIntitiative.Text.ToString().Trim() != "")
         {
             objclsBALApplication = new clsBALApplication();
             string strInitiativeNm = txtIntitiative.Text.ToString();
             bool   blnUpdate       = false;
             bool   blnVisible      = false;
             if (chkUpdate.Checked)
             {
                 blnUpdate = true;
             }
             if (chkVisible.Checked)
             {
                 blnVisible = true;
             }
             bool blnExists = objclsBALApplication.SaveInitiative(strInitiativeNm, blnUpdate, blnVisible);
             if (!blnExists)
             {
                 lblSuccess.Text = "Initiative saved successfully.";
                 PopulateGrid();
             }
             else
             {
                 lblError.Text = "Initiatives already exists.";
             }
         }
         else
         {
             lblError.Text = "Please fill Initiative Name.";
         }
     }
     catch (NullReferenceException)
     {
         Response.Redirect("wfrmErrorPage.aspx", true);
     }
     catch (Exception ex)
     {
         HttpContext  context            = HttpContext.Current;
         LogException objclsLogException = new LogException();
         objclsLogException.LogErrorInDataBase(ex, context);
         Response.Redirect("wfrmErrorPage.aspx", true);
     }
 }