public ActionResult AssignPartial([ModelBinder(typeof(DevExpressEditorsBinder))] IrmaCapaModel model) { string hCapaControl = this.Request.Form["hCapaControl"]; if (model.Id == 0) { model.Status = "Open"; } if ((hCapaControl != null && hCapaControl.Contains("Submit")) || (hCapaControl == null && this.Request.Form["btnCapaSubmit"] != null)) { model.Status = "Submit"; } if (model.AssignedTos != null) { model.AssignedTo = string.Join(",", model.AssignedTos); } model.Source = this.GetSession("source"); if (model.Id == 0) { model.DateAssigned = DateTime.Now; model.SourceId = this.GetSession("sourceId"); model.SourceUrl = this.GetSession("SourceUrl"); model = ServiceSystem.Add(EnscoConstants.EntityModel.IrmaCapa, model, true); } else { ServiceSystem.Save(EnscoConstants.EntityModel.IrmaCapa, model, true); } if (hCapaControl != null) { return(null); } return(RedirectToAction("Index/" + model.Id.ToString())); }
public ActionResult SubmitForVerification(int id) { IServiceDataModel dataModel = ServiceSystem.GetServiceModel(EnscoConstants.EntityModel.IrmaCapaPlan); IrmaCapaPlanModel m = new IrmaCapaPlanModel(); m = dataModel.GetItem("Id=" + id.ToString(), "Id"); m.Status = "Pending Verification"; ServiceSystem.Save(EnscoConstants.EntityModel.IrmaCapaPlan, m, true); TaskModel taskModel = new TaskModel(); taskModel.AssignedAt = DateTime.Now; taskModel.AssignedBy = UtilitySystem.CurrentUserId; int oimId = 0; DataTable dt = this.GetDataSet("select dbo.fn_OimPassportId() ").Tables[0]; if (dt.Rows.Count > 0) { int.TryParse(dt.Rows[0][0].ToString(), out oimId); } taskModel.AssigneeUserId = oimId; taskModel.SourceForm = "CapaPlan"; taskModel.SourceFormId = id.ToString(); taskModel.SourceFormURL = "/irma/capa/capaPlan/" + id.ToString(); taskModel.Status = "Pending"; taskModel.Message = ""; ServiceSystem.Add(EnscoConstants.EntityModel.Task, taskModel, true); return(null); }
public ActionResult CapaPlan([ModelBinder(typeof(DevExpressEditorsBinder))] IrmaCapaPlanModel model) { if (this.Request.Form["Submit"] == "Submit") { model.Status = "Submit"; } if (model.OwnersList != null) { model.Owners = string.Join(",", model.OwnersList); } if (model.Id == 0) { model.DateCreated = DateTime.Now; model.Status = "Open"; model = ServiceSystem.Add(EnscoConstants.EntityModel.IrmaCapaPlan, model, true); string newId = this.Request.Form["SourceFormId"]; if (newId != null) { this.GetDataSet("update Common_Attachments set SourceFormId=" + model.Id.ToString() + " where SourceFormId=" + newId); } } else { ServiceSystem.Save(EnscoConstants.EntityModel.IrmaCapaPlan, model, true); } if (model.Status == "Open") { this.UpdateAttachment(model.Id); } this.UpdateAttachment(0); return(Redirect("/Irma/Capa/CapaPlan/" + model.Id.ToString())); }
public ActionResult GridUpdate([ModelBinder(typeof(DevExpressEditorsBinder))] CapaActionModel model, string clientAction) { model.CapaId = this.CapaId; if (this.ModelState.IsValid) { if (clientAction == "Add") { ServiceSystem.Add(EnscoConstants.EntityModel.CapaAction, model, true); } else if (clientAction == "Delete") { ServiceSystem.Delete(EnscoConstants.EntityModel.CapaAction, model, true); } else { ServiceSystem.Save(EnscoConstants.EntityModel.CapaAction, model, true); } } else { this.SaveModelStateErrors(); } this.GetRolePermission(new string[] { this.CapaId.ToString(), model.Type }); return(PartialView("GridPartial", this.GetActionDataTable(model.Type))); }
public ActionResult ReviewPartial([ModelBinder(typeof(DevExpressEditorsBinder))] IrmaCapaModel model) { if (model.Id == 0) { model = ServiceSystem.Add(EnscoConstants.EntityModel.IrmaCapa, model, true); } else { ServiceSystem.Save(EnscoConstants.EntityModel.IrmaCapa, model, true); } return(RedirectToAction("Index/" + model.Id.ToString())); }
public ActionResult AddCapaAction(string data, string type) { CapaActionModel model = new CapaActionModel(); model.CapaId = this.CapaId; if (type == "Implementation") { model.Who = UtilitySystem.CurrentUserId; model.Comment = data; model.Date = DateTime.Now; } else { model.Who = int.Parse(data); } model.Type = type; ServiceSystem.Add(EnscoConstants.EntityModel.CapaAction, model, true); return(null); }