示例#1
0
        public ActionResult SubmitResponse(string[] arr)
        {
            IServiceDataModel dataModel = ServiceSystem.GetServiceModel(EnscoConstants.EntityModel.Attachment);
            IrmaCapaModel     m         = this.GetModel(this.CapaId);

            m.DateCompleted         = DateTime.Parse(arr[0]);
            m.WO                    = arr[1];
            m.CompletionDescription = arr[2];
            ServiceSystem.Save(EnscoConstants.EntityModel.IrmaCapa, m, true);
            // if(arr != null)
            for (int i = 3; i < arr.Length; i++)
            {
                AttachmentModel attachment = dataModel.GetItem(string.Format("FilePath =\"{0}\"", HttpUtility.UrlDecode(arr[i])), "Id");
                if (attachment != null)
                {
                    dataModel.Delete(attachment);
                }
            }
            //     this.UpdateAttachment(this.CapaId);
            //this.UpdateAttachment(0);

            return(RedirectToAction("Index/" + this.CapaId.ToString()));

            return(null);
        }
示例#2
0
        public void UpdateAttachment(int?id)
        {
            IServiceDataModel dataModel = ServiceSystem.GetServiceModel(EnscoConstants.EntityModel.Attachment);

            if (id != 0)
            {
                string source = this.Session["Source"] == null ? "" : this.Session["Source"].ToString();
                IEnumerable <AttachmentModel> attachments = ServiceSystem.GetAttachments(source, "0");
                if (attachments != null)
                {
                    foreach (AttachmentModel attachment in attachments)
                    {
                        attachment.SourceFormId = id?.ToString();
                        attachment.SourceForm   = "CapaPlan";
                        dataModel.Update(attachment);
                    }
                }
            }
            else
            {
                string[] arr = this.Request.Form.GetValues("Removed");
                if (arr != null)
                {
                    foreach (string path in arr)
                    {
                        AttachmentModel attachment = dataModel.GetItem(string.Format("FilePath =\"{0}\"", HttpUtility.UrlDecode(path)), "Id");
                        if (attachment != null)
                        {
                            dataModel.Delete(attachment);
                        }
                    }
                }
            }
        }
示例#3
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"));
        }
示例#4
0
        public ActionResult RigAssetRelationDelete(RigAssetRelationModel model)
        {
            RigAdminManageModel manageRigModel = (RigAdminManageModel)Session["RigAdminManageModel"];

            if (ModelState.IsValid)
            {
                IServiceDataModel rigRelation = ServiceSystem.GetServiceModel(EnscoConstants.EntityModel.RigAssetRelation);
                if (rigRelation != null)
                {
                    model.RigId = UtilitySystem.Settings.RigId;
                    rigRelation.Delete(model);
                }
            }

            return(PartialView("RigAdminAssetsPartial", manageRigModel));
        }