Example #1
0
        //
        // POST: /StockInBill/DownInBillMaster/
        public ActionResult DownInBillMaster(string beginDate, string endDate, string wareCode, string billType, bool isInDown)
        {
            bool              bResult   = false;
            DownUnitBll       ubll      = new DownUnitBll();
            DownProductBll    pbll      = new DownProductBll();
            DownInBillBll     ibll      = new DownInBillBll();
            DownDecidePlanBll planBll   = new DownDecidePlanBll();
            string            errorInfo = string.Empty;

            try
            {
                beginDate = Convert.ToDateTime(beginDate).ToString("yyyyMMdd");
                endDate   = Convert.ToDateTime(endDate).ToString("yyyyMMdd");
                if (!SystemParameterService.SetSystemParameter())
                {
                    ubll.DownUnitCodeInfo();
                    pbll.DownProductInfo();
                    if (isInDown)
                    {
                        bResult = ibll.GetInBill(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo);
                    }
                    else
                    {
                        bResult = planBll.GetInBillMiddle(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo);
                    }
                }
                else
                {
                    ubll.DownUnitInfo();
                    pbll.DownProductInfos();
                    if (isInDown)
                    {
                        bResult = ibll.GetInBills(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo);
                    }
                    else
                    {
                        bResult = planBll.GetInBillMiddle(beginDate, endDate, this.User.Identity.Name.ToString(), wareCode, billType, out errorInfo);
                    }
                }
            }
            catch (Exception e)
            {
                errorInfo += e.Message;
            }

            string msg = bResult ? "下载成功" : "下载失败";

            return(Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet));
        }
Example #2
0
 private string GetDiskName()
 {
     string diskName = string.Empty;
     SystemParameterService systemParameterService = new SystemParameterService();
     List<SystemParameter> list = systemParameterService.GetAll().ToList();
     if(list != null && list.Count > 0)
     {
         SystemParameter systemParameter = list.FirstOrDefault();
         diskName = systemParameter.UploadDirectory;
         if(string.IsNullOrEmpty(diskName))
         {
             throw new Exception("请在系统设置中选择附件上传路径!");
         }
     }
     return diskName;
 }
Example #3
0
        //主单结单
        // POST: /StockOutBill/DownOutBillMaster/
        public ActionResult DownOutBillMaster(string beginDate, string endDate, string wareCode, string billType)
        {
            string errorInfo = string.Empty;

            beginDate = Convert.ToDateTime(beginDate).ToString("yyyyMMdd");
            endDate   = Convert.ToDateTime(endDate).ToString("yyyyMMdd");
            bool            bResult = false;
            DownUnitBll     ubll    = new DownUnitBll();
            DownProductBll  pbll    = new DownProductBll();
            DownOutBillBll  ibll    = new DownOutBillBll();
            DownCustomerBll custBll = new DownCustomerBll();

            try
            {
                if (!SystemParameterService.SetSystemParameter())
                {
                    ubll.DownUnitCodeInfo();
                    pbll.DownProductInfo();
                    custBll.DownCustomerInfo();
                }
                else
                {
                    ubll.DownUnitInfo();         //创联
                    pbll.DownProductInfos();     //创联
                    custBll.DownCustomerInfos(); //创联
                }
                bResult = ibll.GetOutBills(beginDate, endDate, this.User.Identity.Name.ToString(), out errorInfo, wareCode, billType);
            }
            catch (Exception e)
            {
                errorInfo += e.Message;
            }

            string msg = bResult ? "下载成功" : "下载失败";

            return(Json(JsonMessageHelper.getJsonMessage(bResult, msg, errorInfo), "text", JsonRequestBehavior.AllowGet));
        }