public ActionResult Create(MainViewModel mainViewModel) { using (var context = new SupportSystemSrdjanContext()) { Main main = new Main() { SugestionNo = mainViewModel.SugestionNo, CreatedBy = mainViewModel.CreatedBy, CreatedOn = mainViewModel.CreatedOn, StatusID = mainViewModel.StatusID, CategoryID = mainViewModel.CategoryID, SectionID = mainViewModel.SectionID, SeverityID = mainViewModel.SeverityID, Title = mainViewModel.Title, StepsToReproduce = mainViewModel.StepsToReproduce, PriorityID = mainViewModel.PriorityID, AcceptedOn = mainViewModel.AcceptedOn, DueOn = mainViewModel.DueOn, ResolvedOn = mainViewModel.ResolvedOn, Notes = mainViewModel.ResolveNotes }; context.Mains.Add(main); context.SaveChanges(); return(RedirectToAction("Index", "Main")); } }
public ActionResult Delete(string id) { int mainid = Convert.ToInt32(id); using (var context = new SupportSystemSrdjanContext()) { Main main = context.Mains.Where(m => m.ID == mainid).FirstOrDefault(); MainViewModel mainViewModel = new MainViewModel() { ID = main.ID, SugestionNo = main.SugestionNo, CreatedBy = main.CreatedBy, CreatedOn = main.CreatedOn, StatusID = main.StatusID, StatusName = main.SupportSystemStatu.StatusName, CategoryID = main.CategoryID, CategoryName = main.SupportSystemCategory.CategoryName, SectionID = main.SectionID, SectionName = main.SupportSystemSection.SectionName, SeverityID = main.SeverityID, SeverityName = main.SupportSystemSeverity.SeverityName, Title = main.Title, StepsToReproduce = main.StepsToReproduce, PriorityID = main.PriorityID, PriorityName = main.SupportSystemPriority.PriorityName, AcceptedOn = main.AcceptedOn, DueOn = main.DueOn, ResolvedOn = main.ResolvedOn, ResolveNotes = main.Notes, }; return(View(mainViewModel)); } }
public ActionResult Edit(int id, int sugestionNo, string createdBy, DateTime createdOn, int statusID, int categoryID, int sectionID, int severityID, string title, string stepsToReproduce, int priorityID, DateTime acceptedOn, DateTime dueOn, string resolvedOn, string resolveNotes) { using (var context = new SupportSystemSrdjanContext()) { Main main = context.Mains.Find(id); main.SugestionNo = sugestionNo; main.CreatedBy = createdBy; main.CreatedOn = createdOn; main.StatusID = statusID; main.CategoryID = categoryID; main.SectionID = sectionID; main.SeverityID = severityID; main.Title = title; main.StepsToReproduce = stepsToReproduce; main.PriorityID = priorityID; main.AcceptedOn = acceptedOn; main.DueOn = dueOn; main.ResolvedOn = resolvedOn; main.Notes = resolveNotes; context.SaveChanges(); return(RedirectToAction("Index")); } }
public ActionResult Edit(int id) { using (var context = new SupportSystemSrdjanContext()) { User user = context.Users.Find(id); UserViewModel userViewModel = new UserViewModel() { UserID = user.UserID, FullName = user.FullName, Username = user.Username, Password = user.Password, Address = user.Address, City = user.City, Country = user.Country, Phone = user.Phone, RolesID = user.RolesID, RolesName = user.SupportSystemRole.RolesName, Aktivan = user.Aktivan }; ViewBag.Roles = context.SupportSystemRoles .Select(r => new SelectListItem() { Text = r.RolesName, Value = "" + r.RolesID }).ToList(); return(View(userViewModel)); } }
public ActionResult Index() { using (var context = new SupportSystemSrdjanContext()) { var user = context.Users.Select(u => new UserViewModel() { UserID = u.UserID, FullName = u.FullName, Address = u.Address, City = u.City, Country = u.Country, Phone = u.Phone, Username = u.Username, Password = u.Password, RolesID = u.RolesID, RolesName = u.SupportSystemRole.RolesName, Aktivan = u.Aktivan }).ToList(); ViewBag.Roles = context.SupportSystemRoles .Select(r => new RolasViewModel() { RolesName = r.RolesName, RolesID = r.RolesID }).ToList(); return(View(user)); } }
public ActionResult Delete(int id) { using (var context = new SupportSystemSrdjanContext()) { context.SupportSystemStatus.Remove(context.SupportSystemStatus.Find(id)); context.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Edit(int statusid, string statusName, string description) { using (var context = new SupportSystemSrdjanContext()) { SupportSystemStatu status = context.SupportSystemStatus.Find(statusid); status.StatusName = statusName; status.Description = description; context.SaveChanges(); return(RedirectToAction("Index")); } }
public ActionResult Create() { using (var context = new SupportSystemSrdjanContext()) { ViewBag.Roles = context.SupportSystemRoles .Select(r => new SelectListItem() { Text = r.RolesName, Value = "" + r.RolesID }).ToList(); } return(View()); }
public ActionResult Create(StatusViewModel status) { using (var context = new SupportSystemSrdjanContext()) { context.SupportSystemStatus.Add(new SupportSystemStatu { StatusID = status.StatusID, StatusName = status.StatusName, Description = status.Description, }); context.SaveChanges(); } return(RedirectToAction("Index")); }
// GET: Status public ActionResult Index() { using (var context = new SupportSystemSrdjanContext()) { var status = context.SupportSystemStatus.Select(s => new StatusViewModel() { StatusID = s.StatusID, StatusName = s.StatusName, Description = s.Description, }).ToList(); return(View(status)); } }
public ActionResult Edit(int id) { using (var context = new SupportSystemSrdjanContext()) { SupportSystemSection section = context.SupportSystemSections.Find(id); SectionViewModel sectionViewModel = new SectionViewModel() { SectionID = section.SectionID, SectionName = section.SectionName, Description = section.Description, }; return(View(sectionViewModel)); } }
public ActionResult Create(SectionViewModel section) { using (var context = new SupportSystemSrdjanContext()) { context.SupportSystemSections.Add(new SupportSystemSection { SectionID = section.SectionID, SectionName = section.SectionName, Description = section.Description, }); context.SaveChanges(); } return(RedirectToAction("Index")); }
// GET: Section public ActionResult Index() { using (var context = new SupportSystemSrdjanContext()) { var section = context.SupportSystemSections.Select(s => new SectionViewModel() { SectionID = s.SectionID, SectionName = s.SectionName, Description = s.Description, }).ToList(); return(View(section)); } }
public ActionResult CreateComment(string comment) { using (var context = new SupportSystemSrdjanContext()) { Comment commentModel = new Comment() { CommentName = comment }; context.Comments.Add(commentModel); context.SaveChanges(); return(RedirectToAction("Index", "Main")); } }
public ActionResult Edit(int id) { using (var context = new SupportSystemSrdjanContext()) { SupportSystemStatu status = context.SupportSystemStatus.Find(id); StatusViewModel statusViewModel = new StatusViewModel() { StatusID = status.StatusID, StatusName = status.StatusName, Description = status.Description, }; return(View(statusViewModel)); } }
public ActionResult Create() { using (var context = new SupportSystemSrdjanContext()) { ViewBag.Status = context.SupportSystemStatus .Select(s => new SelectListItem() { Text = s.StatusName, Value = "" + s.StatusID }).ToList(); ViewBag.Section = context.SupportSystemSections .Select(a => new SelectListItem() { Text = a.SectionName, Value = "" + a.SectionID }).ToList(); ViewBag.Severity = context.SupportSystemSeverities .Select(b => new SelectListItem() { Text = b.SeverityName, Value = "" + b.SeverityID }).ToList(); ViewBag.Category = context.SupportSystemCategories .Select(c => new SelectListItem() { Text = c.CategoryName, Value = "" + c.CategoryID }).ToList(); ViewBag.Priority = context.SupportSystemPriorities .Select(p => new SelectListItem() { Text = p.PriorityName, Value = "" + p.PriorityID }).ToList(); ViewBag.Comment = context.Comments .Select(s => new CommentViewModel() { CommentName = s.CommentName, CommentID = s.CommentID }).ToList(); return(View()); } }
public ActionResult Delete(string id) { int sectionid = Convert.ToInt32(id); using (var context = new SupportSystemSrdjanContext()) { SupportSystemSection section = context.SupportSystemSections.Where(u => u.SectionID == sectionid).FirstOrDefault(); SectionViewModel sectionViewModel = new SectionViewModel() { SectionID = section.SectionID, SectionName = section.SectionName, Description = section.Description }; return(View(sectionViewModel)); } }
public ActionResult Delete(string id) { int statusid = Convert.ToInt32(id); using (var context = new SupportSystemSrdjanContext()) { SupportSystemStatu status = context.SupportSystemStatus.Where(u => u.StatusID == statusid).FirstOrDefault(); StatusViewModel statusViewModel = new StatusViewModel() { StatusID = status.StatusID, StatusName = status.StatusName, Description = status.Description }; return(View(statusViewModel)); } }
public ActionResult Edit(int userid, string fullname, string username, string password, string address, string city, string country, string phone, int rolesid, bool aktivan) { using (var context = new SupportSystemSrdjanContext()) { User user = context.Users.Find(userid); user.FullName = fullname; user.Username = username; user.Password = password; user.Address = address; user.City = city; user.Country = country; user.Phone = phone; user.RolesID = rolesid; user.Aktivan = aktivan; context.SaveChanges(); return(RedirectToAction("Index")); } }
public ActionResult Create(UserViewModel userViewModel) { using (var context = new SupportSystemSrdjanContext()) { if (ModelState.IsValid) { try { User user = new User() { FullName = userViewModel.FullName, Address = userViewModel.Address, City = userViewModel.City, Country = userViewModel.Country, Phone = userViewModel.Phone, Username = userViewModel.Username, Password = userViewModel.Password, RolesID = userViewModel.RolesID, Aktivan = userViewModel.Aktivan }; context.Users.Add(user); context.SaveChanges(); return(RedirectToAction("Index")); } catch { ModelState.AddModelError("", ""); } } ViewBag.Roles = context.SupportSystemRoles .Select(r => new SelectListItem() { Text = r.RolesName, Value = "" + r.RolesID }).ToList(); return(View(userViewModel)); } }
public ActionResult Delete(string id) { int userid = Convert.ToInt32(id); using (var context = new SupportSystemSrdjanContext()) { User user = context.Users.Where(u => u.UserID == userid).FirstOrDefault(); UserViewModel userViewModel = new UserViewModel() { UserID = user.UserID, FullName = user.FullName, Username = user.Username, Password = user.Password, Address = user.Address, City = user.City, Country = user.Country, Phone = user.Phone, RolesID = user.RolesID, RolesName = user.SupportSystemRole.RolesName, Aktivan = user.Aktivan }; return(View(userViewModel)); } }
public ActionResult Index() { using (var context = new SupportSystemSrdjanContext()) { var main = context.Mains.Select(m => new MainViewModel() { ID = m.ID, SugestionNo = m.SugestionNo, CreatedBy = m.CreatedBy, CreatedOn = m.CreatedOn, StatusID = m.StatusID, StatusName = m.SupportSystemStatu.StatusName, CategoryID = m.CategoryID, CategoryName = m.SupportSystemCategory.CategoryName, SectionID = m.SectionID, SectionName = m.SupportSystemSection.SectionName, SeverityID = m.SeverityID, SeverityName = m.SupportSystemSeverity.SeverityName, Title = m.Title, StepsToReproduce = m.StepsToReproduce, PriorityID = m.PriorityID, PriorityName = m.SupportSystemPriority.PriorityName, AcceptedOn = m.AcceptedOn, DueOn = m.DueOn, ResolvedOn = m.ResolvedOn, ResolveNotes = m.Notes, CommentID = m.Comment.CommentID, CommentName = m.Comment.CommentName }).ToList(); ViewBag.Status = context.SupportSystemStatus .Select(s => new StatusViewModel() { StatusName = s.StatusName, StatusID = s.StatusID }).ToList(); ViewBag.Section = context.SupportSystemSections .Select(a => new SectionViewModel() { SectionName = a.SectionName, SectionID = a.SectionID }).ToList(); ViewBag.Severity = context.SupportSystemSeverities .Select(b => new SeverityViewModel() { SeverityName = b.SeverityName, SeverityID = b.SeverityID }).ToList(); ViewBag.Category = context.SupportSystemCategories .Select(c => new CategoryViewModel() { CategoryName = c.CategoryName, CategoryID = c.CategoryID }).ToList(); ViewBag.Priority = context.SupportSystemPriorities .Select(p => new PriorityViewModel() { PriorityName = p.PriorityName, PriorityID = p.PriorityID }).ToList(); return(View(main)); } }
public ActionResult Edit(int id) { using (var context = new SupportSystemSrdjanContext()) { Main main = context.Mains.Find(id); MainViewModel mainViewModel = new MainViewModel() { ID = main.ID, SugestionNo = main.SugestionNo, CreatedBy = main.CreatedBy, CreatedOn = main.CreatedOn, StatusID = main.StatusID, StatusName = main.SupportSystemStatu.StatusName, CategoryID = main.CategoryID, CategoryName = main.SupportSystemCategory.CategoryName, SectionID = main.SectionID, SectionName = main.SupportSystemSection.SectionName, SeverityID = main.SeverityID, SeverityName = main.SupportSystemSeverity.SeverityName, Title = main.Title, StepsToReproduce = main.StepsToReproduce, PriorityID = main.PriorityID, PriorityName = main.SupportSystemPriority.PriorityName, AcceptedOn = main.AcceptedOn, DueOn = main.DueOn, ResolvedOn = main.ResolvedOn, ResolveNotes = main.Notes }; ViewBag.Status = context.SupportSystemStatus .Select(s => new SelectListItem() { Text = s.StatusName, Value = "" + s.StatusID }).ToList(); ViewBag.Section = context.SupportSystemSections .Select(a => new SelectListItem() { Text = a.SectionName, Value = "" + a.SectionID }).ToList(); ViewBag.Severity = context.SupportSystemSeverities .Select(b => new SelectListItem() { Text = b.SeverityName, Value = "" + b.SeverityID }).ToList(); ViewBag.Category = context.SupportSystemCategories .Select(c => new SelectListItem() { Text = c.CategoryName, Value = "" + c.CategoryID }).ToList(); ViewBag.Priority = context.SupportSystemPriorities .Select(p => new SelectListItem() { Text = p.PriorityName, Value = "" + p.PriorityID }).ToList(); ViewBag.Comment = context.Comments .Select(s => new CommentViewModel() { CommentName = s.CommentName, CommentID = s.CommentID }).ToList(); return(View(mainViewModel)); } }