protected void updatecate(object sender, EventArgs e) { string id = Request["id"]; dc = new DTO_Categories(); dc.Category_ID_ = txtcateid.Text; dc.Category_name_ = txtcatename.Text; dc.Description_ = txtdescription.Text; dc.Group_ID_ = txtgroupid.Text; bc.updateCategories(dc); Response.Redirect("Categories.aspx"); }
protected void insertcate(object sender, EventArgs e) { if (Page.IsValid) { dc = new DTO_Categories(); dc.Category_ID_ = txtcateid.Text; dc.Category_name_ = txtcatename.Text; dc.Description_ = txtdescription.Text; dc.Group_ID_ = txtgroupid.Text; bc.insertCategories(dc); Response.Redirect("Categories.aspx"); } }
public void insertCategories(DTO_Categories dc) { string sql = "insert into Categories values('" + dc.Category_ID_ + "',N'" + dc.Category_name_ + "',N'" + dc.Description_ + "',N'" + dc.Group_ID_ + "')"; da.ExcuteNonQuery(sql); }
public void updateCategories(DTO_Categories dc) { string sql = "update Categories set category_name=N'" + dc.Category_name_ + "', description=N'" + dc.Description_ + "', group_ID=N'" + dc.Group_ID_ + "' where category_id='" + dc.Category_ID_ + "'"; da.ExcuteNonQuery(sql); }