示例#1
0
 public void Mod()
 {
     if (CheckAjax())
     {
         if (CheckRight())
         {
             if (IsPost)
             {
                 M.ProductCategory category = new M.ProductCategory()
                 {
                     Id       = int.Parse(Request["Id"]),
                     Name     = Request["Name"],
                     Image    = Request["Image"],
                     ShowLogo = Types.GetBooleanFromString(Request["ShowLogo"]),
                     SortNum  = int.Parse(Request["SortNum"])
                 };
                 SetResult(category.Update(DataSource), () =>
                 {
                     WritePostLog("MOD");
                 });
             }
             else
             {
                 NotFound();
             }
         }
     }
 }
示例#2
0
 public void Parents(int id)
 {
     if (CheckAjax())
     {
         if (CheckRight())
         {
             List <int>        list = new List <int>();
             M.ProductCategory ac   = M.ProductCategory.GetById(DataSource, id);
             list.Add(ac.Id);
             while (ac.ParentId != 0)
             {
                 ac = M.ProductCategory.GetById(DataSource, ac.ParentId);
                 list.Insert(0, ac.Id);
             }
             SetResult(list.ToArray());
         }
     }
 }
示例#3
0
 public void Del()
 {
     if (CheckAjax())
     {
         if (CheckRight())
         {
             if (IsPost)
             {
                 M.ProductCategory category = new M.ProductCategory()
                 {
                     Id = int.Parse(Request["Id"])
                 };
                 SetResult(category.Delete(DataSource), () =>
                 {
                     WritePostLog("DEL");
                 });
             }
             else
             {
                 NotFound();
             }
         }
     }
 }