public JsonResult AddPhasebyAjax(int id, string phasename, bool isActive, bool isCurrent) { ProjectPhases phase = new ProjectPhases(); phase.PhaseName = phasename; phase.IsActive = isActive; phase.IsCurrent = isCurrent; phase.CreatedOn = DateTime.Now; phase.ProjectId = id; phase.CreatedBy = Convert.ToInt32(Session["userId"] as string); _objProjectPhase.Insert(phase); return(this.Json(true, JsonRequestBehavior.AllowGet)); }
public JsonResult ChnageStatusbyAjax(int id) { ProjectPhases Current = _objProjectPhase.FindById(id); if (Current.IsCurrent == true) { Current.IsCurrent = false; } else { Current.IsCurrent = true; } _objProjectPhase.Update(Current); return(this.Json(true, JsonRequestBehavior.AllowGet)); }
public JsonResult UpdatePhasebyAjax(int id, string phasename, bool isActive, bool isCurrent, int UId) { ProjectPhases phase = new ProjectPhases(); phase.Id = UId; phase.PhaseName = phasename; phase.IsActive = isActive; phase.IsCurrent = isCurrent; phase.CreatedBy = _dbContext.ProjectPhases.Where(c => c.Id == UId).Select(x => x.CreatedBy).SingleOrDefault(); phase.CreatedOn = _dbContext.ProjectPhases.Where(c => c.Id == UId).Select(x => x.CreatedOn).SingleOrDefault(); phase.UpdatedOn = DateTime.Now; phase.ProjectId = id; phase.UpdateBy = Convert.ToInt32(Session["userId"] as string); phase.UpdatedIPAddress = Convert.ToString(IpAddr); _objProjectPhase.Update(phase); return(this.Json(true, JsonRequestBehavior.AllowGet)); }