Ejemplo n.º 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 V_DelegateSendModel();
            List <V_DelegateSendDetailModel> list = new List <V_DelegateSendDetailModel>();
            var message = "";
            var order   = "";

            if (type == "" || no == "")
            {
                #region 创建申请单
                type = "add";
                no   = bomService.GetDelegateSendNo();
                #endregion
            }
            else if (type == "edit")
            {
                model = ServiceDB.Instance.QueryOneModel <V_DelegateSendModel>("select * from V_DelegateSendModel where sendNo='" + no + "'");
            }
            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 = ServiceDB.Instance.QueryModelList <V_DelegateSendDetailModel>("select * from V_DelegateSendDetailModel where sendNo='" + no + "'").ToList();
            SessionHelper.SetSession("DS" + no + Masterpage.CurrUser.staffid, list);
            #endregion
            data.order   = order;
            data.message = message;
            data.type    = type;
            return(View(data));
        }