protected void Page_Load(object sender, EventArgs e) { try { string name = Request["name"]; string description = Request["description"]; int categoryID = Convert.ToInt32(Request["ID"]); CategoryManager CM = new CategoryManager(); CategoryTBx category = CM.GetByID(categoryID); category.Name = Request["name"]; if (Convert.ToInt32(Request["parentID"]) != 0) { category.ParentID = Convert.ToInt32(Request["parentID"]); } category.Description = Request["description"]; category.Order = 1; category.Status = 1; category.Description = description; category.Name = name; CM.Save(); Response.Write(JsonConvert.SerializeObject(new { success = 1 })); } catch (Exception ex) { Response.Write(JsonConvert.SerializeObject(new { success = -1, error = ex })); } }
protected void Page_Load(object sender, EventArgs e) { try { CategoryManager CM = new CategoryManager(); CategoryTBx category = new CategoryTBx(); category.Name = Request["name"]; category.Order = Convert.ToInt32(Request["order"]); if (Convert.ToInt32(Request["parentID"]) != 0) { category.ParentID = Convert.ToInt32(Request["parentID"]); } category.Description = Request["description"]; category.Status = 1; CM.AddNew(category); Response.Write(JsonConvert.SerializeObject(new { success = 1 })); } catch (Exception ex) { Response.Write(JsonConvert.SerializeObject(new { success = -1, error = ex })); } }
protected void Page_Load(object sender, EventArgs e) { try { CategoryManager CM = new CategoryManager(); CategoryTBx cate = new CategoryTBx(); int id = Convert.ToInt32(Request["id"]); cate = CM.GetByID(id); cate.name = Request["categoryname"]; cate.typecategory = Request["type"]; cate.status = 1; CM.Save(); Response.Write(JsonConvert.SerializeObject(new { success = 1 })); } catch (Exception ex) { Response.Write(JsonConvert.SerializeObject(new { success = -1, error = ex })); } }
protected void Page_Load(object sender, EventArgs e) { CategoryManager CM = new CategoryManager(); int id = Convert.ToInt32(Request.QueryString["id"]); cate = CM.GetByID(id); }
protected void Page_Load(object sender, EventArgs e) { CategoryManager CM = new CategoryManager(); listParent = CM.GetList().Where(t => t.ParentID == null).ToList(); int ID = Convert.ToInt32(Page.RouteData.Values["categoryID"]); category = CM.GetByID(ID); }
protected void Page_Load(object sender, EventArgs e) { CategoryTBx category = new CategoryTBx(); CategoryManager cm = new CategoryManager(); category.Name = Request["cat"]; category.Status = 1; cm.AddNew(category); }
protected void Page_Load(object sender, EventArgs e) { int id = Convert.ToInt32(Request["id"]); CategoryManager cm = new CategoryManager(); delete = cm.GetByID(id); delete.Status = -1; cm.Save(); Response.Write(1); }
protected void Page_Load(object sender, EventArgs e) { try { int id = Convert.ToInt32(Request["id"]); CategoryManager cm = new CategoryManager(); delete = cm.GetByID(id); delete.Status = -1; cm.Save(); Response.Write(JsonConvert.SerializeObject(new { success = 1 })); } catch (Exception ex) { Response.Write(JsonConvert.SerializeObject(new { success = -1, error = ex })); } }
public void AddNew(CategoryTBx ele) { db.CategoryTBxes.InsertOnSubmit(ele); Save(); }
public void AddNew(CategoryTBx category) { db.CategoryTBxes.InsertOnSubmit(category); Save(); }
public void Add(CategoryTBx cate) { DB.CategoryTBxes.InsertOnSubmit(cate); DB.SubmitChanges(); }
partial void DeleteCategoryTBx(CategoryTBx instance);
partial void UpdateCategoryTBx(CategoryTBx instance);
partial void InsertCategoryTBx(CategoryTBx instance);