コード例 #1
0
ファイル: VVIController.cs プロジェクト: rivernli/SGP
        public ActionResult VVIReturn()
        {
            string postData = Request["postData"];
            SystemMessages sysMsg = new SystemMessages();
            if (!String.IsNullOrWhiteSpace(postData))
            {
                System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
                Dictionary<string, object> jsonData = jss.Deserialize<Dictionary<string, object>>(postData) as Dictionary<string, object>;

                string dataId = Convert.ToString(jsonData["dataId"]);
                string VendorRFQNumber = Convert.ToString(jsonData["returnid"]);

                try
                {
                    VVIQuotationDetail dm = new VVIQuotationDetail();
                    if (dm.CheckVendorRFQStatus(VendorRFQNumber, Int32.Parse(dataId)) == true)
                    {
                        dm.ReturnRFQ(VendorRFQNumber, Int32.Parse(dataId));
                       // WFTemplate wf = new WFTemplate(4, Int32.Parse(dataId), VendorRFQNumber);
                       // wf.Run();
                    }
                    else
                    {
                        sysMsg.isPass = false;
                        sysMsg.Messages.Add("Error", "don't need change the status.");
                    }
                }
                catch (Exception ex)
                {
                    sysMsg.isPass = false;
                    sysMsg.Messages.Add("Error", ex.Message);
                }

            }

            var jsonResult = new
            {
                SysMsg = sysMsg,
            };
            return Json(jsonResult);
        }
コード例 #2
0
ファイル: VVIController.cs プロジェクト: rivernli/SGP
        public ActionResult VendorRFQStatus()
        {
            SystemMessages sysMsg = new SystemMessages();
            int id = 0;
            string postData = Request["postData"];
            System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
            Dictionary<string, object> jsonData = jss.Deserialize<Dictionary<string, object>>(postData) as Dictionary<string, object>;
            Dictionary<string, object> data = jsonData["data"] as Dictionary<string, object>;
            string dataId = Convert.ToString(jsonData["dataId"]);
            string operation = Convert.ToString(jsonData["operation"]);
            Int32.TryParse(dataId, out id);
            string VendorRFQNumber = "";
            VVIQuotationDetail dm = new VVIQuotationDetail();
            try
            {
                if (jsonData.ContainsKey("returnid"))
                {
                    VendorRFQNumber = Convert.ToString(jsonData["returnid"]);
                    sysMsg.isPass = dm.CheckVendorRFQStatus(VendorRFQNumber, id);
                }
                else if (jsonData.ContainsKey("redoid"))
                {
                    VendorRFQNumber = Convert.ToString(jsonData["redoid"]);
                    sysMsg.isPass = !dm.CheckVendorRFQStatus(VendorRFQNumber, id);
                }
            }
            catch (Exception ex)
            {
                sysMsg.isPass = false;
            }

            var returnData = new
            {
                SysMsg = sysMsg
            };
            return Json(returnData, JsonRequestBehavior.AllowGet);
        }