public void Setup() { manager = new CategoryManager(); category1 = new Category { name = "Apple US", image = "ca_appleus" }; category2 = new Category { name = "Amazon", image = "ca_amazon" }; manager.AddNew(category1); manager.AddNew(category2); }
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) { CategoryTBx category = new CategoryTBx(); CategoryManager cm = new CategoryManager(); category.Name = Request["cat"]; category.Status = 1; cm.AddNew(category); }