示例#1
0
        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()));
        }
示例#2
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);
        }
示例#3
0
        public ActionResult SearchPartial(int id)
        {
            IrmaCapaModel  m  = new IrmaCapaModel();
            DataTableModel dt = this.GetDataTable("IrmaCapa");

            this.ViewBag.dt = dt;
            return(PartialView("SearchPartial", m));
        }
示例#4
0
        public ActionResult RespondPartial([ModelBinder(typeof(DevExpressEditorsBinder))]  IrmaCapaModel model)
        {
            IrmaCapaModel m = this.GetModel(this.CapaId);

            m.DateCompleted         = model.DateCompleted;
            m.WO                    = model.WO;
            m.CompletionDescription = model.CompletionDescription;
            ServiceSystem.Save(EnscoConstants.EntityModel.IrmaCapa, m, true);

            return(RedirectToAction("Index/" + this.CapaId.ToString()));
        }
示例#5
0
        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()));
        }
示例#6
0
        IrmaCapaModel GetModel(int id)
        {
            IServiceDataModel dataModel = ServiceSystem.GetServiceModel(EnscoConstants.EntityModel.IrmaCapa);
            IrmaCapaModel     m         = dataModel.GetItem("Id=" + id.ToString(), "Id");

            if (m != null)
            {
                m.AssignedTos = m.AssignedTo == null ? null : m.AssignedTo.Split(',');
                //m.NotifyIds = m.NotifyId == null ? null : m.NotifyId.Split(',');
            }
            else
            {
                m = new IrmaCapaModel();
            }
            this.CapaId = m.Id;
            return(m);
        }
示例#7
0
        public ActionResult Index(int?id = 0, string source = "", string sourceUrl = "", string sourceId = "")
        {
            IrmaCapaModel model = new IrmaCapaModel();

            Session["IrmaCapaModel"] = model;
            if (id == 0)
            {
                this.SetSession("source", source);
                this.SetSession("sourceId", sourceId);
                this.SetSession("sourceUrl", sourceUrl);
            }
            this.CapaId               = id.Value;
            this.ViewBag.Extension    = this.GetActionDataTable("Extension");
            this.ViewBag.Reassignment = this.GetActionDataTable("Reassignment");
            DataSet ds = this.GetDataSet("usp_GetCapaExtensionRequest", new string[] { id.ToString() });

            this.ViewBag.DataSet = ds;
            return(View(id));
        }
示例#8
0
        public ActionResult SearchPartial([ModelBinder(typeof(DevExpressEditorsBinder))]  IrmaCapaModel model)
        {
            DataTableModel dt = this.GetDataTable("IrmaCapa");

            string where = " 1=1 ";
            object value;
            string name;

            foreach (PropertyInfo prop in model.GetType().GetProperties())
            {
                var type = Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType;
                name = prop.Name;
                if (name == "AssignedTos")
                {
                    continue;
                }
                value = prop.GetValue(model, null);
                if (value == null || value.ToString() == "")
                {
                    continue;
                }
                if (type == typeof(DateTime))
                {
                    continue;
                }
                else if (type != typeof(int))
                {
                    value = "\"" + value + "\"";
                }
                else if (value.ToString() == "0")
                {
                    continue;
                }

                where += " and " + name + "=" + value;
            }
            dt.Dataset      = dt.Dataset.Where(where);
            this.ViewBag.dt = dt;
            return(PartialView("SearchPartial"));
        }
示例#9
0
        public ActionResult AssignPartial(int id)
        {
            this.GetRolePermission(new string[] { this.CapaId.ToString(), "Create" });
            IrmaCapaModel m = this.GetModel(id);

            if (id == 0)
            {
                //if (this.ViewData["source"] != null) {
                //    //this.SetSession("source", this.ViewData["source"].ToString());
                //    //this.SetSession("sourceId", this.ViewData["sourceId"].ToString());
                //    //this.SetSession("sourceUrl", this.ViewData["sourceUrl"].ToString());
                //    m.Source = this.GetSession("source");
                //    m.DateAssigned = DateTime.Now;
                //}
                m.DateAssigned         = DateTime.Now;
                m.Source               = this.GetSession("source");
                this.Session["Status"] = m.Status;
            }
            else
            {
                this.SetSession("source", m.Source);
            }
            return(PartialView("AssignPartial", m));
        }