protected void txt_SubCatName_TextChanged(object sender, EventArgs e)
 {
     try
     {
         IAdmin    checkSubCatName = new AdminItems();
         DataTable dt = checkSubCatName.checkSubCatName(txt_SubCatName.Text, Int32.Parse(ddl_Catagory.SelectedValue));
         if (dt != null)
         {
             img_SubCatName.ImageUrl  = "~/images/unavailable.png";
             img_SubCatName.Visible   = true;
             lbl_SubCatName.Text      = "Name already Exist";
             lbl_SubCatName.ForeColor = System.Drawing.Color.Red;
             txt_SubCatName.Focus();
         }
         else
         {
             img_SubCatName.ImageUrl  = "~/images/tick.png";
             img_SubCatName.Visible   = true;
             lbl_SubCatName.Text      = "Not Exist in DB";
             lbl_SubCatName.ForeColor = System.Drawing.Color.Green;
         }
     }
     catch (Exception ex)
     {
         lbl_SubCatName.Text = HardCodedValues.BuddaResource.CatchBlockError + ex.Message;
     }
 }
示例#2
0
 private DataTable getSubCatg()
 {
     try
     {
         IAdmin    checkSubCatName = new AdminItems();
         DataTable dt = checkSubCatName.checkSubCatName(string.Empty, Int32.Parse(ddl_catagory.SelectedValue));
         return(dt);
     }
     catch (Exception ex)
     {
         lbl_status.Text = HardCodedValues.BuddaResource.CatchBlockError + ex.Message;
         return(null);
     }
 }
        private void getSubCatg()
        {
            try
            {
                IAdmin    checkSubCatName = new AdminItems();
                DataTable dt = checkSubCatName.checkSubCatName(txt_SubCatName.Text, Int32.Parse(CatagoryDDL.SelectedValue));

                SubCatagoryDDL.DataSource     = dt;
                SubCatagoryDDL.DataTextField  = "SubCatName";
                SubCatagoryDDL.DataValueField = "SubCatId";
                SubCatagoryDDL.DataBind();
            }
            catch (Exception ex)
            {
                ItemMessageLbl.Text = HardCodedValues.BuddaResource.CatchBlockError + ex.Message;
            }
        }