예제 #1
0
 protected void btnSaveCategory_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtCategory.Text.Length > 0)
         {
             uc.AddCategory(txtCategory.Text);
             string textmsg = " Category Added Successfully";
             ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpopsuccess('" + textmsg + "')</script>", false);
             txtCategory.Text = string.Empty;
             category.Visible = false;
             btnCate.Visible  = false;
             btnhide.Visible  = true;
             Gf.FillCategory("ec_id", "ex_categoryname", "ExpenseCategory", ddlCategory, "");
         }
         else
         {
             string txtmsg = "Please Enter Category Name";
             ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + txtmsg + "')</script>", false);
         }
     }
     catch (Exception ex)
     {
         string exxmsg = ex.Message.ToString();
         ScriptManager.RegisterStartupScript(this, typeof(Page), "Warning", "<script>showpoperror('" + exxmsg + "')</script>", false);
     }
 }