예제 #1
0
        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);
        }
예제 #2
0
        public ActionResult CapaPlan(int?id = 0)
        {
            IServiceDataModel dataModel = ServiceSystem.GetServiceModel(EnscoConstants.EntityModel.IrmaCapaPlan);
            IrmaCapaPlanModel m         = new IrmaCapaPlanModel();

            if (id == 0)
            {
                this.Session["Source"] = Guid.NewGuid().ToString();
                m.RigId = UtilitySystem.CurrentRigId;
            }
            else
            {
                m = dataModel.GetItem("Id=" + id.ToString(), "Id");
            }
            m.OwnersList        = (m.Owners == null ? UtilitySystem.CurrentUserId.ToString() : m.Owners).Split(',');
            Session["CapaPlan"] = m;
            bool readOnly = true;

            if (id == 0 || (m.OwnersList.Contains(UtilitySystem.CurrentUserId.ToString()) && m.Status == "Open"))
            {
                readOnly = false;
            }
            this.ViewBag.readOnly = readOnly;

            this.ViewBag.dsSummary = this.GetDataSet("exec usp_GetCapaPlanSummary " + id.ToString());
            return(View(m));
        }
예제 #3
0
        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()));
        }
예제 #4
0
        public ActionResult CapaPlanDelete(int id)
        {
            IServiceDataModel dataModel = ServiceSystem.GetServiceModel(EnscoConstants.EntityModel.IrmaCapaPlan);
            IrmaCapaPlanModel m         = new IrmaCapaPlanModel();

            m.Id = id;
            dataModel.Delete(m, true);
            return(Redirect("/irma/capa/CapaPlanHome"));
        }