示例#1
0
 public fwMenu Insert(fwMenu obj)
 {
     var ID = DataUtilities.Insert(@"insert into fwMenu([Title], [ParentID], [Url], [Icon], [Order], [Actived],[SubAction]) values(@Title, @ParentID, @Url, @Icon, @Order, @Actived, @SubAction)",
         CommandType.Text, "@Title", obj.Title, "@ParentID", obj.ParentID, "@Url", obj.Url, "@Icon", obj.Icon, "@Order", obj.Order, "@Actived", obj.Actived, "@SubAction", obj.SubAction);
     obj.ID = ID;
     return obj;
 }
示例#2
0
 public ActionResult AddRoleToMenu(int groupID, string listID)
 {
     var g = new fwMenu() { ID = groupID };
     var lst = listID.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
     foreach (var item in g.fwRole.Select(m => m.ID).ToList())
     {
         if (!lst.Contains(item.ToString()))
             g.RemoveRole(item);
     }
     foreach (var item in lst)
     {
         g.AddRole(int.Parse(item));
     }
     return RedirectToAction("ListMenu");
 }
示例#3
0
 public ActionResult EditMenu(fwMenu model)
 {
     if (model.ID == 0)
         new fwMenuDAL().Insert(model);
     else
         new fwMenuDAL().Update(model);
     return RedirectToAction("ListMenu");
 }
示例#4
0
 public fwMenu Update(fwMenu obj)
 {
     var ID = DataUtilities.ExcuteNonQuery(@"update fwMenu set [Title] = @Title, [ParentID]=@ParentID, [Url]=@Url, [Icon]=@Icon, [Order]=@Order, [Actived]=@Actived, SubAction=@SubAction where ID=@ID",
         CommandType.Text, "@Title", obj.Title, "@ParentID", obj.ParentID, "@Url", obj.Url, "@Icon", obj.Icon,
         "@Order", obj.Order, "@Actived", obj.Actived, "@SubAction", obj.SubAction, "@ID", obj.ID);
     return obj;
 }
示例#5
0
 private fwMenu CreateObj(DataRow row)
 {
     var obj = new fwMenu();
     obj.ID = (int)row["ID"];
     obj.Title = (string)row["Title"];
     obj.ParentID = GetInt(row["ParentID"]);
     obj.Url = GetString(row["Url"]);
     obj.Icon = GetString(row["Icon"]);
     obj.Order = GetInt(row["Order"]);
     obj.Actived = GetBool(row["Actived"]);
     obj.SubAction = GetString(row["SubAction"]);
     return obj;
 }