示例#1
0
 private bool isUserExisting()
 {
     string userid = this.txtCategory.Text;
     busThick buscat = new busThick();
     FrameWork.Thick frmcat = new FrameWork.Thick();
     frmcat = buscat.isUserExisting(userid);
     //FrameWork.Employees log = busemp.isUserExisting(userid);
     if (frmcat == null)
     {
         return false;
     }
     else if (userid.Equals(frmcat.Thickness))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
示例#2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            busThick buscat = new busThick();
            FrameWork.Thick frmcat = new FrameWork.Thick();
            frmcat.Thickness = this.txtCategory.Text;

            isExisting = isUserExisting();
            if (isExisting.Equals(true))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Width existing')", true);
            }
            else
            {
                buscat.insertCategory(frmcat);
            }
            DataTable dt = new DataTable("User");
            dt = buscat.allCategories();
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }