public ActionResult Update(int Id, string Adress, string Name, DateTime BirthDate, string Cellphone, string CEP, byte?Gender, int IdGroup, string Phone) { try { UserService.Update(new DAL.Users() { Id = Id, Adress = Adress, Name = Name, BirthDate = BirthDate, Cellphone = Cellphone, CEP = CEP, Gender = Gender, IdGroup = IdGroup, Phone = Phone }); InternalNotification.Success("User updated"); return(RedirectToAction("index")); } catch (Exception ex) { InternalNotification.Error(ex.Message); RedirectToAction("insert"); } return(RedirectToAction("index")); }
public ActionResult Create(string Groups, int Type, string Name, string Description, IEnumerable <HttpPostedFileBase> Files, DateTime BeginDate, DateTime EndDate, bool IsBroadcast = false, HttpPostedFileBase imageFile = null) { try { var IdsGroup = GetIdsFromString(Groups); var FilesDTO = GetFiles(Files); HttpFileStream imageFileStream = null; if (imageFile != null) { imageFileStream = new HttpFileStream() { InputStream = imageFile.InputStream, Name = imageFile.FileName }; } ContentService.CreateContent(IdsGroup, null, Type, Name, Description, FilesDTO, BeginDate, EndDate, IsBroadcast, imageFileStream); InternalNotification.Success("Material Created"); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }
public ActionResult ResendActivationEmail(string Email) { try { UserService.ResendActiveEmail(Email, GetActiveEndPoint()); InternalNotification.Success("The email was sent"); } catch (Exception ex) { InternalNotification.Error(ex.Message); } return(RedirectToAction("index")); }
public ActionResult Delete(int Id) { try { var Deleted = UserService.Delete(Id); InternalNotification.Success("User deleted"); } catch (Exception ex) { InternalNotification.Error(ex.Message); } return(RedirectToAction("index")); }
public ActionResult Delete(int Id) { try { GroupService.Delete(Id); InternalNotification.Success("Group Deleted"); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }
public ActionResult Update(int Id, string Name, bool IsActive = false) { try { GroupService.Update(Id, Name, IsActive); InternalNotification.Success("Group updated"); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }
public ActionResult Update(DAL.Genres genre, int id) { try { genreService.Update(id, genre); InternalNotification.Success("Genre updated"); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }
public ActionResult Create(string Name) { try { GroupService.Create(Name); string Message = "Group Created"; InternalNotification.Success(Message); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }
public ActionResult Delete(int Id) { try { ContentService.Delete(Id); string Message = "Material deleted"; InternalNotification.Success(Message); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }
public ActionResult Delete(int Id) { try { var genre = genreService.Find(Id); genreService.Delete(genre); InternalNotification.Success("Genre Deleted"); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }
public ActionResult Create(string name, int?idParent) { try { genreService.Create(name, idParent); string Message = "Genre Created"; InternalNotification.Success(Message); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }
public ActionResult Update(int Id, string Groups, string Name, string Description, IEnumerable <HttpPostedFileBase> Files, DateTime BeginDate, DateTime EndDate, bool IsBroadcast = false) { try { var IdsGroup = GetIdsFromString(Groups); var idsTypes = GetIdsFromString(Groups); var FilesDTO = GetFiles(Files); ContentService.UpdateContent(Id, IdsGroup, idsTypes, Name, Description, FilesDTO, BeginDate, EndDate, IsBroadcast); InternalNotification.Success("Material Updated"); } catch (Exception ex) { InternalNotification.Error(ex); } return(RedirectToAction("index")); }