protected void Button1_Click(object sender, EventArgs e) { int er = 0; lblMessage.Text = ""; if (txtProductName.Text == "") { er++; RequiredFieldValidator1.Text = "Required"; } if (txtProductPrice.Text == "") { er++; RequiredFieldValidator3.Text = "Required"; } if (er > 0) { return; } DAL.product p = new DAL.product(); p.Name = txtProductName.Text; p.Descriptioin = txtProductDescription.Text; p.CategoryId = Convert.ToInt32(ddlProduct.SelectedItem.Value); p.price = Convert.ToDouble(txtProductPrice.Text); p.Image = System.IO.Path.GetFileName(fileImg.FileName); if (p.Insert()) { lblMessage.Text = "Data Inserted"; lblMessage.ForeColor = System.Drawing.Color.Green; fileImg.SaveAs(Server.MapPath("uploads/productImages/" + p.Image)); } else { lblMessage.Text = p.Error; lblMessage.ForeColor = System.Drawing.Color.Red; } }
// public int num_cateid(int cateid) { DAL.product dal = new DAL.product(); return(dal.num_cateid(cateid)); }
public DataSet p_dataset(int cateid, int pageindex, int pagesize, string table) { DAL.product dal = new DAL.product(); return(dal.p_dateset(cateid, pageindex, pagesize, table)); }
public SqlDataReader drpr(Model.product aa) { DAL.product dalps = new DAL.product(); return(dalps.drpr(aa)); }
public SqlDataReader drim(Model.product aa) { DAL.product dalpdd = new DAL.product(); return(dalpdd.drima(aa)); }
public int update(Model.product mym) { DAL.product dal = new DAL.product(); return(dal.update(mym)); }
// public DataSet drpo(Model.product aa) { DAL.product dalp = new DAL.product(); return(dalp.drpo(aa)); }
public string select_imageid(Model.product mym) { DAL.product dal = new DAL.product(); return(dal.select_imageid(mym)); }
public SqlDataReader selectupdate(int mym) { DAL.product dal = new DAL.product(); return(dal.selectupdate(mym)); }
public DataSet select_title(Model.product mym) { DAL.product dal = new DAL.product(); return(dal.select_title(mym)); }
public int delete_id(Model.product mym) { DAL.product dal = new DAL.product(); return(dal.delete_id(mym)); }
public DataSet dataset() { DAL.product dal = new DAL.product(); return(dal.dataset()); }
public int insert(Model.product mym) { DAL.product dal = new DAL.product(); return(dal.Insert(mym)); }
public product() { dal = new DAL.product("fg_"); }