Beispiel #1
0
        //
        // GET: /B2F/
        public ActionResult Detail(string RFQID)
        {
            int dataId = ParseHelper.Parse<int>(RFQID);

            WFTemplate template = new WFTemplate(2, dataId);
            List<FieldCategory> lfc = FieldCategory.GetMasterCategorys(FieldCategory.Category_TYPE_B2F);

            if (dataId > 0)
            {
                B2FQuotationDetail b2Detail = new B2FQuotationDetail();
                b2Detail.FillCategoryData(lfc, dataId);
            }

            ViewBag.WFTemplate = template;
            ViewBag.Categories = lfc;
            ViewBag.DataId = dataId;
            return View();
        }
Beispiel #2
0
        public ActionResult WFSkip()
        {
            SystemMessages sysMsg = WFHelper.CreateMessages();
            string html = "";
            string wfStatus = "";

            string postData = Request["postData"];
            int id = Save(postData, sysMsg);

            if (sysMsg.isPass && id > 0)
            {
                List<int> lstToChildIds = new List<int>();
                string templateName = Request["templateName"];
                string toChildIds = Request["toChildIds"];
                int entityId = id;
                int fromId = ParseHelper.Parse<int>(Request["fromId"]);
                int toId = ParseHelper.Parse<int>(Request["toId"]);
                bool checkData = !(Request["checkData"] == "false");
                bool waitAllChildComplated = !(Request["waitAllChildComplated"] == "false");

                if (!String.IsNullOrWhiteSpace(toChildIds))
                {
                    foreach (string stcid in toChildIds.Split(','))
                    {
                        int tcid = ParseHelper.Parse<int>(stcid);
                        if (tcid > 0)
                        {
                            lstToChildIds.Add(Convert.ToInt32(tcid));
                        }
                    }
                }

                WFTemplate wfTemplate = new WFTemplate(templateName, entityId);

                using (TScope ts = new TScope())
                {
                    if (toId == 0)
                    {
                        sysMsg.Merge(wfTemplate.Run(fromId, checkData));
                    }
                    else
                    {
                        sysMsg.Merge(wfTemplate.Skip(toId, fromId, checkData, waitAllChildComplated, lstToChildIds.ToArray()));
                    }

                    if (!sysMsg.isPass)
                    {
                        ts.Rollback();
                    }
                }

                B2FQuotationDetail b2Detail = new B2FQuotationDetail();
                List<FieldCategory> lfc = FieldCategory.GetMasterCategorys(FieldCategory.Category_TYPE_B2F);
                b2Detail.FillCategoryData(lfc, id);
                html = DetailUIHelper.GenrateCategories(lfc, wfTemplate);
                wfStatus = wfTemplate.Status == WorkflowStatus.Finished ? "Finished" : "";
            }
            var jsonResult = new
            {
                DataId = id,
                SysMsg = sysMsg,
                Html = html,
                wfStatus = wfStatus
            };
            return Json(jsonResult);
        }
Beispiel #3
0
        public ActionResult SaveData()
        {
            SystemMessages sysMsg = new SystemMessages();
            string html = "";
            string wfStatus = "";
            int id = 0;
            string postData = Request["postData"];
            id = Save(postData, sysMsg);

            if (id > 0 && sysMsg.isPass)
            {
                WFTemplate wfTemplate = new WFTemplate(2, id);
                B2FQuotationDetail b2Detail = new B2FQuotationDetail();
                List<FieldCategory> lfc = FieldCategory.GetMasterCategorys(FieldCategory.Category_TYPE_B2F);
                b2Detail.FillCategoryData(lfc, id);
                html = DetailUIHelper.GenrateCategories(lfc, wfTemplate);
                wfStatus = wfTemplate.Status == WorkflowStatus.Finished ? "Finished" : "";
            }
            var jsonResult = new
            {
                DataId = id,
                SysMsg = sysMsg,
                Html = html,
                wfStatus = wfStatus
            };
            return Json(jsonResult);
        }