Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = string.Format("{0}WareHouse/StockInList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 41, new List<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);

                this.curStockType = (int)NFMT.Data.StyleEnum.库存类型;
                this.curCustomType = (int)NFMT.Data.StyleEnum.报关状态;

                if (string.IsNullOrEmpty(Request.QueryString["id"]))
                    Response.Redirect(redirectUrl);

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

                NFMT.WareHouse.BLL.StockInBLL stockInBLL = new NFMT.WareHouse.BLL.StockInBLL();
                NFMT.Common.ResultModel result = stockInBLL.Get(user, stockInId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.WareHouse.Model.StockIn stockIn = result.ReturnValue as NFMT.WareHouse.Model.StockIn;
                this.curStockIn = stockIn;

                if (stockIn != null)
                {
                    NFMT.Common.AuditModel model = new NFMT.Common.AuditModel()
                    {
                        AssName = stockIn.AssName,
                        DalName = stockIn.DalName,
                        DataBaseName = stockIn.DataBaseName,
                        Id = stockIn.Id,
                        Status = stockIn.Status,
                        TableName = stockIn.TableName
                    };
                    string json = serializer.Serialize(model);
                    this.hidmodel.Value = json;
                }
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = string.Format("{0}WareHouse/StockMoveList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 46, new List<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);

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

                this.hidid.Value = stockMoveId.ToString();

                NFMT.WareHouse.BLL.StockMoveBLL stockMoveBLL = new NFMT.WareHouse.BLL.StockMoveBLL();
                NFMT.Common.ResultModel result = stockMoveBLL.Get(user, stockMoveId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

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

                NFMT.WareHouse.BLL.StockMoveDetailBLL stockMoveDetailBLL = new NFMT.WareHouse.BLL.StockMoveDetailBLL();
                NFMT.Common.StatusEnum getDetailStatus = NFMT.Common.StatusEnum.已生效;

                if (stockMove.MoveStatus == NFMT.Common.StatusEnum.已完成)
                    getDetailStatus = NFMT.Common.StatusEnum.已完成;
                else if (stockMove.MoveStatus == NFMT.Common.StatusEnum.已关闭)
                    getDetailStatus = NFMT.Common.StatusEnum.已关闭;

                result = stockMoveDetailBLL.Load(user, stockMoveId, getDetailStatus);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                List<NFMT.WareHouse.Model.StockMoveDetail> stockMoveDetails = result.ReturnValue as List<NFMT.WareHouse.Model.StockMoveDetail>;
                if (stockMoveDetails == null || !stockMoveDetails.Any())
                    Response.Redirect(redirectUrl);

                foreach (NFMT.WareHouse.Model.StockMoveDetail detail in stockMoveDetails)
                {
                    NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL();
                    result = stockBLL.Get(user, detail.StockId);
                    if (result.ResultStatus != 0)
                        Response.Redirect(redirectUrl);

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

                    NFMT.Data.Model.DeliverPlace deliverPlace = NFMT.Data.BasicDataProvider.DeliverPlaces.SingleOrDefault(a => a.DPId == stock.DeliverPlaceId);
                    if (deliverPlace == null)
                        Response.Redirect(redirectUrl);

                    break;
                }

                this.hidStockMoveApplyId.Value = stockMove.StockMoveApplyId.ToString();

                this.txbMoveMemo.InnerText = stockMove.MoveMemo;

                NFMT.Common.AuditModel auditModel = new NFMT.Common.AuditModel()
                {
                    AssName = stockMove.AssName,
                    DalName = stockMove.DalName,
                    DataBaseName = stockMove.DataBaseName,
                    Id = stockMove.Id,
                    Status = stockMove.Status,
                    TableName = stockMove.TableName
                };
                string json = serializer.Serialize(auditModel);
                this.hidModel.Value = json;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            string redirectUrl = string.Format("{0}WareHouse/StockInList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 41, new List<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);

                this.curStockType = (int)NFMT.Data.StyleEnum.库存类型;
                this.curCustomType = (int)NFMT.Data.StyleEnum.报关状态;

                if (string.IsNullOrEmpty(Request.QueryString["id"]))
                    Response.Redirect(redirectUrl);

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

                NFMT.WareHouse.BLL.StockInBLL stockInBLL = new NFMT.WareHouse.BLL.StockInBLL();
                NFMT.Common.ResultModel result = stockInBLL.Get(user, stockInId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.WareHouse.Model.StockIn stockIn = result.ReturnValue as NFMT.WareHouse.Model.StockIn;
                this.curStockIn = stockIn;

                if (stockIn != null)
                {
                    NFMT.Common.AuditModel model = new NFMT.Common.AuditModel()
                    {
                        AssName = stockIn.AssName,
                        DalName = stockIn.DalName,
                        DataBaseName = stockIn.DataBaseName,
                        Id = stockIn.Id,
                        Status = stockIn.Status,
                        TableName = stockIn.TableName
                    };
                    string json = serializer.Serialize(model);
                    this.hidmodel.Value = json;
                }

                //获取入库合约关联表
                NFMT.WareHouse.BLL.ContractStockIn_BLL contractStockInBLL = new NFMT.WareHouse.BLL.ContractStockIn_BLL();
                NFMT.Common.ResultModel res = contractStockInBLL.GetByStockInId(user, stockIn.StockInId, NFMT.Common.StatusEnum.已录入);
                if (res.ResultStatus == 0)
                {
                    NFMT.WareHouse.Model.ContractStockIn contractStockIn = res.ReturnValue as NFMT.WareHouse.Model.ContractStockIn;
                    if (contractStockIn != null && contractStockIn.RefId > 0)
                    {
                        this.curContractStockIn = contractStockIn;

                        //获取子合约
                        NFMT.Contract.BLL.ContractSubBLL contractSubBLL = new NFMT.Contract.BLL.ContractSubBLL();
                        res = contractSubBLL.Get(user, contractStockIn.ContractSubId);
                        if (res.ResultStatus != 0)
                            Response.Redirect(redirectUrl);

                        NFMT.Contract.Model.ContractSub contractSub = res.ReturnValue as NFMT.Contract.Model.ContractSub;
                        if (contractSub == null)
                            Response.Redirect(redirectUrl);

                        this.curSubId = contractSub.SubId;

                        res = stockInBLL.Load(user, contractSub.SubId, NFMT.Common.StatusEnum.已录入);
                        if (res.ResultStatus != 0)
                            Response.Redirect(redirectUrl);

                        List<NFMT.WareHouse.Model.StockIn> stockIns = res.ReturnValue as List<NFMT.WareHouse.Model.StockIn>;
                        if (stockIns == null)
                            Response.Redirect(redirectUrl);

                        decimal sumWeight = stockIns.Sum(temp => temp.GrossAmount);
                        int contractId = contractSub.ContractId;

                        //获取合约
                        NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
                        res = contractBLL.Get(user, contractId);
                        if (res.ResultStatus != 0)
                            Response.Redirect(redirectUrl);

                        NFMT.Contract.Model.Contract contract = res.ReturnValue as NFMT.Contract.Model.Contract;
                        if (contract == null)
                            Response.Redirect(redirectUrl);

                        this.contractExpander1.CurContract = contract;
                        this.contractExpander1.CurContractSub = contractSub;
                        this.contractExpander1.RedirectUrl = redirectUrl;
                    }
                }
            }
        }