public ActionResult AddUserToGroup(int groupID, int userID, string returnUrl)
 {
     var g = new fwGroup();
     g.ID = groupID;
     g.AddUser(userID);
     return RedirectToAction("AddUserToGroup", new { groupID = groupID, returnUrl = returnUrl });
 }
Beispiel #2
0
 public fwGroup Insert(fwGroup obj)
 {
     var ID = DataUtilities.Insert("insert into fwGroup([Title]) values(@Title)",
         CommandType.Text, "@Title", obj.Title);
     obj.ID = ID;
     return obj;
 }
 public ActionResult AddRoleToGroup(int groupID, string listID)
 {
     var g = new fwGroup() { 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("ListGroup");
 }
 public ActionResult EditGroup(fwGroup model, string returnUrl)
 {
     if (model.ID == 0)
         new fwGroupDAL().Insert(model);
     else
         new fwGroupDAL().Update(model);
     return Redirect(returnUrl);
 }
Beispiel #5
0
 private fwGroup CreateObj(DataRow row)
 {
     var obj = new fwGroup();
     obj.ID = (int)row["ID"];
     obj.Title = GetString(row["Title"]);
     return obj;
 }
Beispiel #6
0
 public fwGroup Update(fwGroup obj)
 {
     var ID = DataUtilities.ExcuteNonQuery("update fwGroup set [Title] = @Title where ID = @ID",
         CommandType.Text, "@Title", obj.Title, "@ID", obj.ID);
     return obj;
 }