public ActionResult Edit(CreateProjectModel objcreateproject) { CreateProjectDTO objcreate = new CreateProjectDTO(); List <string> Developesassigned = new List <string>(); if (objcreateproject.UserIds.Trim().Length > 1) { Developesassigned = objcreateproject.UserIds.Split('#').ToList(); } string updatedby = User.Identity.GetUserId(); ProjectDTO obj = new ProjectDTO { ID = objcreateproject.ID, UpdatedBy = updatedby, Name = objcreateproject.Name, Description = objcreateproject.Description, Duration = objcreateproject.Duration, ClientID = objcreateproject.ClientID, PManagerID = objcreateproject.PManagerID, ProposedEndDate = objcreateproject.ProposedEndDate, ShortName = objcreateproject.ShortName, SignUpDate = objcreateproject.SignUpDate, StartDate = objcreateproject.StartDate }; obj.CreatedBy = User.Identity.GetUserId(); objcreate.objProject = obj; objcreate.Users = Developesassigned.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList(); CustomResponse res = APICalls.Put("projectsapi/Put", objcreate); if (res.Status == CustomResponseStatus.Successful) { return(RedirectToRoute("ProjectHomeRoute")); } else { TempData["Message"] = "Failed to Update Project."; return(RedirectToAction("Create")); } }
public JsonResult GenerateReportEmail(string userID, string TaskStatus, string TaskType, string FromDate, string ToDate) { ReportsModel objreportdata = BindReportData(); ReportDTO objreportdto = new ReportDTO { UserID = userID, TaskStatusID = Convert.ToInt32(TaskStatus), TaskTypeID = Convert.ToInt32(TaskType), FromDate = Convert.ToDateTime(FromDate), ToDate = Convert.ToDateTime(ToDate) }; CustomResponse response = APICalls.Put("userreportapi/Put", objreportdto); return(Json(new { response.Message }, JsonRequestBehavior.AllowGet)); }
public JsonResult ChangePassword(string oldpassword, string newpassword) { MyIdentityUser user = userManager.FindByName(HttpContext.User.Identity.Name); ChangePasswordDTO objchangepassword = new ChangePasswordDTO { userid = user.Id, oldpassword = oldpassword, newpassword = newpassword, ChageType = 2 }; CustomResponse restype1 = APICalls.Put("AuthenticationAPI/Put", objchangepassword); return(Json(restype1, JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateTaskStatus(int taskid, int status) { CustomResponse res = APICalls.Put("TaskTrasactionsAPI/Put?ticketid=" + taskid + "&status=" + status + "&updatedby=" + User.Identity.GetUserId(), null); if (res.Status == CustomResponseStatus.Successful) { return(RedirectToRoute("EditTicketRoute", new { ticketid = taskid })); } ViewBag.Message = "Failed to Create Task"; return(RedirectToRoute("EditTicketRoute", new { ticketid = taskid })); }
public ActionResult ResetPassword(string userid, string token, string newpassword) { ChangePasswordDTO objchangepassword = new ChangePasswordDTO { userid = userid, oldpassword = token, newpassword = newpassword, ChageType = 1 }; CustomResponse objres = APICalls.Put("AuthenticationAPI/Put", objchangepassword); if (objres.Status == CustomResponseStatus.Successful) { return(RedirectToRoute("LoginRoute")); } else { ViewBag.Message = "Failed to update password"; } return(View()); }
public ActionResult Edit(CreateTaskDTO objcreateTask) { objcreateTask.CreatedBy = User.Identity.GetUserId(); string updatedby = User.Identity.GetUserId(); TaskDTO objtaskdto = new TaskDTO { ID = objcreateTask.ID, UpdatedBy = updatedby, Title = objcreateTask.Title, Task_Status = objcreateTask.Task_Status, Description = objcreateTask.Description, DueDate = objcreateTask.DueDate, PriorityID = objcreateTask.PriorityID, TypeID = objcreateTask.TypeID, RefereedTo = objcreateTask.RefereedTo, AssignedTo = objcreateTask.AssignedTo, CreatedBy = objcreateTask.CreatedBy, AssigndedDate = objcreateTask.AssigndedDate, ProjectID = objcreateTask.ProjectID }; CustomResponse res = APICalls.Put("TasksAPI/Put", objtaskdto); if (res.Status == CustomResponseStatus.Successful) { // TempData["Message"] = res.Message; return(RedirectToRoute("TicketsHomeRoute", new { ProjectID = 0 })); } ViewBag.Message = "Failed to Update Task"; return(RedirectToRoute("TicketsHomeRoute", new { ProjectID = 0 })); }
public ActionResult EditUser(UserDTO objuser) { objuser.CreatedBy = User.Identity.GetUserId(); ChangePasswordDTO objuserinfo = new ChangePasswordDTO { userid = objuser.Id, FirstName = objuser.FirstName, LastName = objuser.LastName, Email = objuser.Email, MobileNumber = objuser.MobileNumber, ChageType = 3 }; CustomResponse objres = APICalls.Put("AuthenticationAPI/Put", objuserinfo); if (objres.Status == CustomResponseStatus.Successful) { return(RedirectToRoute("UsersHomeRoute", new { Role = "" })); } else { ViewBag.Message = "Error While Updating User"; } return(View()); }
public async Task <InventoryViewModel> Update(InventoryViewModel entity) => await APICalls <InventoryViewModel> .Put(InventoryUrl, entity);