示例#1
0
 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
         }));
     }
 }
示例#2
0
    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);
    }
示例#5
0
    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);
    }
示例#7
0
    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);
    }
示例#8
0
 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
         }));
     }
 }
示例#9
0
 public void AddNew(CategoryTBx ele)
 {
     db.CategoryTBxes.InsertOnSubmit(ele);
     Save();
 }
示例#10
0
 public void AddNew(CategoryTBx category)
 {
     db.CategoryTBxes.InsertOnSubmit(category);
     Save();
 }
示例#11
0
 public void Add(CategoryTBx cate)
 {
     DB.CategoryTBxes.InsertOnSubmit(cate);
     DB.SubmitChanges();
 }
示例#12
0
 partial void DeleteCategoryTBx(CategoryTBx instance);
示例#13
0
 partial void UpdateCategoryTBx(CategoryTBx instance);
示例#14
0
 partial void InsertCategoryTBx(CategoryTBx instance);