Ejemplo n.º 1
0
        protected string GetDetailHTML(NFMT.Common.UserModel user, List<NFMT.WareHouse.Model.StockOutDetail> details)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            NFMT.WareHouse.Model.Stock stock = new NFMT.WareHouse.Model.Stock();
            NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL();
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            foreach (NFMT.WareHouse.Model.StockOutDetail detail in details)
            {
                result = stockBLL.Get(user, detail.StockId);
                if (result.ResultStatus != 0)
                    continue;

                stock = result.ReturnValue as NFMT.WareHouse.Model.Stock;
                if (stock == null)
                    continue;

                sb.Append("<tr class=\"txt\">");
                sb.AppendFormat("<td>{0}</td>", stock.CardNo);
                sb.AppendFormat("<td>{0}</td>", NFMT.Data.BasicDataProvider.Assets.SingleOrDefault(a => a.AssetId == stock.AssetId).AssetName);
                sb.AppendFormat("<td>{0}</td>", NFMT.Data.BasicDataProvider.Brands.SingleOrDefault(a => a.BrandId == stock.BrandId).BrandName);
                sb.AppendFormat("<td>{0}</td>", detail.GrossAmount);
                sb.Append("<td>&nbsp;</td>");
                sb.Append("<td>&nbsp;</td>");
                sb.Append("<td>&nbsp;</td>");
                sb.Append("</tr>");

                if (string.IsNullOrEmpty(this.DPName))
                    DPName = NFMT.Data.BasicDataProvider.DeliverPlaces.SingleOrDefault(a => a.DPId == stock.DeliverPlaceId).DPName;
            }

            return sb.ToString();
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            string redirectUrl = string.Format("{0}WareHouse/StockReceiptUpdateList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            this.hidBDStyleId.Value = ((int)NFMT.Data.StyleEnum.报关状态).ToString();

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 131, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 });

                this.navigation1.Routes.Add("库存净重回执修改列表", redirectUrl);
                this.navigation1.Routes.Add("库存净重回执修改", string.Empty);

                detailId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out detailId) || detailId <= 0)
                    this.WarmAlert("参数错误", redirectUrl);

                stockId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["stockId"]) || !int.TryParse(Request.QueryString["stockId"], out stockId) || stockId <= 0)
                    this.WarmAlert("参数错误", redirectUrl);

                stockLogId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["stockLogId"]) || !int.TryParse(Request.QueryString["stockLogId"], out stockLogId) || stockLogId <= 0)
                    this.WarmAlert("参数错误", redirectUrl);

                NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL();
                result = stockBLL.Get(user, stockId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                stock = result.ReturnValue as NFMT.WareHouse.Model.Stock;
                if (stock == null)
                    this.WarmAlert("获取库存出错", redirectUrl);

                NFMT.WareHouse.BLL.StockNameBLL stockNameBLL = new NFMT.WareHouse.BLL.StockNameBLL();
                result = stockNameBLL.Get(user, stock.StockNameId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                stockName = result.ReturnValue as NFMT.WareHouse.Model.StockName;
                if (stockName == null)
                    this.WarmAlert("获取业务单号出错", redirectUrl);

                NFMT.WareHouse.BLL.StockReceiptDetailBLL stockReceiptDetailBLL = new NFMT.WareHouse.BLL.StockReceiptDetailBLL();
                result = stockReceiptDetailBLL.Get(user, detailId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                stockReceiptDetail = result.ReturnValue as NFMT.WareHouse.Model.StockReceiptDetail;
                if (stockName == null)
                    this.WarmAlert("获取仓库回执出错", redirectUrl);

                this.spStockStatus.InnerText = ((NFMT.WareHouse.StockStatusEnum)stock.StockStatus).ToString();
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            string redirectUrl = string.Format("{0}WareHouse/SplitDocList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            this.hidBDStyleId.Value = ((int)NFMT.Data.StyleEnum.报关状态).ToString();

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 93, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.执行完成, NFMT.Common.OperateEnum.执行完成撤销 });

                this.navigation1.Routes.Add("拆单", redirectUrl);
                this.navigation1.Routes.Add("拆单明细", string.Empty);

                int splitDocId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out splitDocId) || splitDocId <= 0)
                    Response.Redirect(redirectUrl);

                NFMT.WareHouse.BLL.SplitDocBLL splitDocBLL = new NFMT.WareHouse.BLL.SplitDocBLL();
                result = splitDocBLL.Get(user, splitDocId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                splitDoc = result.ReturnValue as NFMT.WareHouse.Model.SplitDoc;
                if (splitDoc == null)
                    Response.Redirect(redirectUrl);

                NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL();
                result = stockBLL.Get(user, splitDoc.OldStockId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                stock = result.ReturnValue as NFMT.WareHouse.Model.Stock;
                if (stock == null)
                    Response.Redirect(redirectUrl);

                NFMT.WareHouse.BLL.StockNameBLL stockNameBLL = new NFMT.WareHouse.BLL.StockNameBLL();
                result = stockNameBLL.Get(user, stock.StockNameId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                stockName = result.ReturnValue as NFMT.WareHouse.Model.StockName;
                if (stockName == null)
                    Response.Redirect(redirectUrl);

                this.spStockStatus.InnerText = ((NFMT.WareHouse.StockStatusEnum)stock.StockStatus).ToString();

                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                this.hidModel.Value = serializer.Serialize(splitDoc);

                //attach
                this.attach1.BusinessIdValue = this.splitDoc.SplitDocId;
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.VerificationUtility ver = new Utility.VerificationUtility();
            ver.JudgeOperate(this.Page, 58, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

            int allotId = 0;
            string redirctUrl = "CashInAllotStockList.aspx";

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

            if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out allotId) || allotId <= 0)
                Response.Redirect(redirctUrl);

            //获取收款分配主表
            NFMT.Funds.BLL.CashInBLL cashInBLL = new NFMT.Funds.BLL.CashInBLL();
            result = cashInBLL.Get(user, allotId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirctUrl);

            cashInAllot = result.ReturnValue as NFMT.Funds.Model.CashInAllot;
            if (cashInAllot == null)
                Response.Redirect(redirctUrl);

            NFMT.Common.StatusEnum status = NFMT.Common.StatusEnum.已生效;
            if (cashInAllot.AllotStatus == NFMT.Common.StatusEnum.已完成)
                status = NFMT.Common.StatusEnum.已完成;
            else if (cashInAllot.AllotStatus == NFMT.Common.StatusEnum.已作废)
                status = NFMT.Common.StatusEnum.已作废;
            else if (cashInAllot.AllotStatus == NFMT.Common.StatusEnum.已关闭)
                status = NFMT.Common.StatusEnum.已关闭;

            //通过收款分配Id获取库存收款分配明细表
            NFMT.Funds.BLL.CashInStcokBLL cashInStcokBLL = new NFMT.Funds.BLL.CashInStcokBLL();
            result = cashInStcokBLL.LoadByAllot(user, allotId, status);
            if (result.ResultStatus != 0)
                Response.Redirect(redirctUrl);

            NFMT.Funds.Model.CashInStcok cashInStock = result.ReturnValue as NFMT.Funds.Model.CashInStcok;
            if (cashInStock == null)
                Response.Redirect(redirctUrl);

            int stockLogId = cashInStock.StockLogId;

            //获取库存流水
            NFMT.WareHouse.BLL.StockLogBLL stockLogBLL = new NFMT.WareHouse.BLL.StockLogBLL();
            result = stockLogBLL.Get(user, stockLogId);

            if (result.ResultStatus != 0)
                Response.Redirect(redirctUrl);

            NFMT.WareHouse.Model.StockLog stockLog = result.ReturnValue as NFMT.WareHouse.Model.StockLog;
            if (stockLog == null || stockLog.StockLogId <= 0)
                Response.Redirect(redirctUrl);

            this.curStockLog = stockLog;

            //获取子合约
            NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
            result = subBLL.Get(user, stockLog.SubContractId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirctUrl);

            NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
            if (sub == null || sub.SubId <= 0)
                Response.Redirect(redirctUrl);

            this.curSub = sub;

            //合约抬头
            NFMT.Contract.BLL.ContractCorporationDetailBLL ccdBll = new NFMT.Contract.BLL.ContractCorporationDetailBLL();

            //内部公司
            result = ccdBll.LoadCorpListByContractId(user, sub.ContractId, true);
            List<NFMT.Contract.Model.ContractCorporationDetail> innerCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;

            foreach (NFMT.Contract.Model.ContractCorporationDetail innerCorp in innerCorps)
            {
                this.spnInCorpNames.InnerHtml += string.Format("[{0}]  ", innerCorp.CorpName);
            }

            //外部公司
            result = ccdBll.LoadCorpListByContractId(user, sub.ContractId, false);
            List<NFMT.Contract.Model.ContractCorporationDetail> outCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;
            foreach (NFMT.Contract.Model.ContractCorporationDetail outCorp in outCorps)
            {
                this.spnOutCorpNames.InnerHtml += string.Format("[{0}]  ", outCorp.CorpName);
            }

            NFMT.Data.Model.MeasureUnit mu = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == sub.UnitId);
            if (mu != null && mu.MUId > 0)
                this.spnSignAmount.InnerHtml = string.Format("{0},{1}", sub.SignAmount, mu.MUName);

            //获取库存
            NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL();
            result = stockBLL.Get(user, stockLog.StockId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirctUrl);

            NFMT.WareHouse.Model.Stock stock = result.ReturnValue as NFMT.WareHouse.Model.Stock;
            if (stock == null || stock.StockId <= 0)
                Response.Redirect(redirctUrl);

            this.curStock = stock;

            //获取业务单号
            NFMT.WareHouse.BLL.StockNameBLL stockNameBLL = new NFMT.WareHouse.BLL.StockNameBLL();
            result = stockNameBLL.Get(user, stock.StockNameId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirctUrl);

            NFMT.WareHouse.Model.StockName stockName = result.ReturnValue as NFMT.WareHouse.Model.StockName;
            if (stockName == null || stockName.StockNameId <= 0)
                Response.Redirect(redirctUrl);

            this.spanRefNo.InnerHtml = stockName.RefNo;
            this.spanStockDate.InnerHtml = stock.StockDate.ToShortDateString();

            NFMT.User.Model.Corporation ownCorp = NFMT.User.UserProvider.Corporations.FirstOrDefault(temp => temp.CorpId == stock.CorpId);

            if (ownCorp != null && ownCorp.CorpId > 0)
                this.spanCorpId.InnerHtml = ownCorp.CorpName;

            if (mu != null && mu.MUId > 0)
                this.spanGrossAmout.InnerHtml = string.Format("{0},{1}", stock.GrossAmount, mu.MUName);

            NFMT.Data.Model.Asset ass = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == stock.AssetId);
            if (ass != null && ass.AssetId > 0)
                this.spanAssetId.InnerHtml = ass.AssetName;

            NFMT.Data.Model.Brand bra = NFMT.Data.BasicDataProvider.Brands.FirstOrDefault(temp => temp.BrandId == stock.BrandId);
            if (bra != null && bra.BrandId > 0)
                this.spanBrandId.InnerHtml = bra.BrandName;

            this.navigation1.Routes.Add("库存分配列表", redirctUrl);
            this.navigation1.Routes.Add("库存分配修改", string.Empty);

            this.JsonOutCorp = Newtonsoft.Json.JsonConvert.SerializeObject(outCorps);

            for (int i = 0; i < outCorps.Count; i++)
            {
                NFMT.Contract.Model.ContractCorporationDetail corp = outCorps[i];
                if (corp.CorpId > 0)
                {
                    if (i != 0)
                        this.curOutCorpIds += ",";

                    this.curOutCorpIds += corp.CorpId;
                }
            }

            NFMT.Funds.BLL.CashInStcokBLL bll = new NFMT.Funds.BLL.CashInStcokBLL();
            NFMT.Common.SelectModel select = bll.GetCurDetailsSelect(1, 100, "cisr.RefId desc", stockLogId);
            result = bll.Load(user, select);

            int totalRows = result.AffectCount;
            System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;

            this.JsonContractSelect = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());
        }