Example #1
0
 public ActionResult requireorder()
 {
     dynamic data = new System.Dynamic.ExpandoObject();
     var no = WebRequest.GetString("no", true);
     var type = WebRequest.GetString("type", true);
     var model = new PurchaseModel();
     var list = new List<PurchaseDetailModel>();
     var message = "";
     var order = "";
     if (type == "" || no == "")
     {
         #region 创建申请单
         type = "add";
         no = purchaseService.GetPurchaseNo();
         #endregion
     }
     else if (type == "edit")
     {
         model = purchaseService.PurchaseList(no).FirstOrDefault();
     }
     var ddl = purchaseService.QuerySupplier(0,1).ToList();
     data.ddl = ddl; data.no = no;
     data.one = model;
     #region 默认申请单
     var had = purchaseService.GetCurchaseHadOrder(no);
     if (had != null && had.Count > 0) order = had[0].text;
     else
     {
         var all = purchaseService.GetNeedBuyOrder("");
         if (all != null && all.Count > 0) order = all[0].text;
     }
     list = purchaseService.PurchaseDetailList2(no);
     SessionHelper.SetSession("PO2" + no + Masterpage.CurrUser.staffid, list);
     #endregion
     data.order = order;
     data.message = message;
     data.type = type;
     return View(data);
 }
Example #2
0
        public ActionResult orderone()
        {
            dynamic data = new System.Dynamic.ExpandoObject();
            var no = WebRequest.GetString("no", true);
            var type = WebRequest.GetString("type", true);
            var model = new PurchaseModel();

            var message = "";
            if (type == "" || no == "")
            {
                #region 创建申请单
                type = "add";
                no = purchaseService.GetPurchaseNo();

                // string backno = purchaseService.AddRequire("",Masterpage.CurrUser.staffid,Masterpage.CurrUser.depId,0,remark);

                #endregion
            }
            else if (type == "edit")
            {
                model = purchaseService.PurchaseList(no).FirstOrDefault();
            }
            var ddl = purchaseService.QuerySupplier(0,1).ToList();
            data.ddl = ddl; data.no = no;
            data.one = model;
            data.message = message;
            data.type = type;
            return View(data);
        }