protected void btnAdd_OnClick(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtProductName.Text.Trim()))
            {
                objCom.productName = txtProductName.Text;
            }
            if (!string.IsNullOrEmpty(txtCategory.Text.Trim()))
            {
                objCom.productCategory = txtCategory.Text;
            }
            if (!string.IsNullOrEmpty(txtProductRate.Text.Trim()))
            {
                objCom.productRate = txtProductRate.Text;
            }
            objCom.isActive = chkStatus.Checked;
            objCom.userId   = Convert.ToInt32(Session["UserId"].ToString());

            int i = objDa.AddProducts(objCom);

            if (i > 0)
            {
                Response.Write("<script>alert('Product Added Successfully!!!')</script>");
                Response.Redirect("AddEditProduct.aspx");
            }
        }
Exemple #2
0
 public int AddProduct(Product objProduct)
 {
     return(objProductDal.AddProducts(objProduct));
 }