示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "InvoiceProvisionalList.aspx";

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

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

                //获取合约与子合约
                int subId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out subId))
                    Response.Redirect(redirectUrl);

                NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBLL.Get(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

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

                this.curContractSub = sub;

                NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                if (currency != null && currency.CurrencyId > 0)
                    this.currencyName = currency.CurrencyName;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.Buy)
                {
                    outSelf = 0;
                    inSelf = 1;
                    invoiceDirection = NFMT.Invoice.InvoiceDirectionEnum.收取;
                }

                this.SelectJson(sub.SubId, invoiceDirection);

                this.navigation1.Routes.Add("临票列表", redirectUrl);
                this.navigation1.Routes.Add(string.Format("临票新增", invoiceDirection), string.Empty);

                this.contractExpander1.CurContract = contract;
                this.contractExpander1.CurContractSub = sub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.navigation1.Routes.Add("制单指令列表", "OrderList.aspx");
                this.navigation1.Routes.Add("可制单合约列表", "OrderContractList.aspx");
                this.navigation1.Routes.Add("制单指令新增", string.Empty);

                string redirectUrl = "OrderList.aspx";

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

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

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                this.curDeptId = user.DeptId;

                NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL();
                NFMT.Common.ResultModel result = subBll.Get(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.ContractId == 0)
                    Response.Redirect(redirectUrl);
                this.curSub = sub;

                NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL();
                result = bll.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract con = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (con == null || con.ContractId == 0)
                    Response.Redirect(redirectUrl);
                this.curContract = con;

                NFMT.Data.Model.Asset ass = NFMT.Data.BasicDataProvider.Assets.First(temp => temp.AssetId == con.AssetId);
                this.curAsset = ass;

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == con.UnitId);
                this.curMUName = muContract.MUName;

                NFMT.Data.Model.Currency cur = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                this.curCurrency = cur;

                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curSub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 43, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 });

                this.navigation1.Routes.Add("出库申请列表", "StockOutApplyList.aspx");
                this.navigation1.Routes.Add("可配货子合约列表", "StockOutApplyContractList.aspx");
                this.navigation1.Routes.Add("子合约配货", string.Empty);

                string redirectUrl = "StockOutApplyContractList.aspx";

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

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

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

                this.curDeptId = user.DeptId;

                NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL();
                NFMT.Common.ResultModel result = subBll.Get(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.ContractId == 0)
                    Response.Redirect(redirectUrl);

                this.curSub = sub;

                NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL();
                result = bll.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract con = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (con == null || con.ContractId == 0)
                    Response.Redirect(redirectUrl);

                this.curContract = con;

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curSub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.VerificationUtility ver = new Utility.VerificationUtility();
            ver.JudgeOperate(this.Page, 57, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 });

            string redirectUrl = string.Format("{0}Funds/ContractReceivableReadyContractList.aspx", NFMT.Common.DefaultValue.NftmSiteName);
            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            if (!IsPostBack)
            {
                this.navigation1.Routes.Add("合约收款分配", string.Format("{0}Funds/ContractReceivableList.aspx", NFMT.Common.DefaultValue.NftmSiteName));
                this.navigation1.Routes.Add("可收款分配合约列表", redirectUrl);
                this.navigation1.Routes.Add("合约收款分配新增", string.Empty);

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

                NFMT.Contract.BLL.ContractSubBLL contractSubBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = contractSubBLL.Get(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.SubId <= 0)
                    Response.Redirect(redirectUrl);

                this.curSub = sub;

                this.spnSubNo.InnerText = sub.SubNo;
                NFMT.Data.Model.MeasureUnit measureUnit = NFMT.Data.BasicDataProvider.MeasureUnits.SingleOrDefault(a => a.MUId == sub.UnitId);
                if (measureUnit != null)
                    this.spnSubSignAmount.InnerText = sub.SignAmount.ToString() + measureUnit.MUName;
                this.spnPeriodE.InnerText = sub.ContractPeriodE.ToShortDateString();

                //this.spanAllotAmount.InnerText = result.ReturnValue == null ? "" : result.ReturnValue.ToString();

                result = contractSubBLL.GetContractOutCorp(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                if (dt == null || dt.Rows.Count == 0)
                    Response.Redirect(redirectUrl);

                this.JsonOutCorp = Newtonsoft.Json.JsonConvert.SerializeObject(result.ReturnValue);

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "InvoiceSuppleFinalList.aspx";

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

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

                //获取终票
                int finalId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out finalId))
                    Response.Redirect(redirectUrl);

                NFMT.Invoice.BLL.BusinessInvoiceBLL businessInvoiceBLL = new NFMT.Invoice.BLL.BusinessInvoiceBLL();
                result = businessInvoiceBLL.Get(user, finalId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Invoice.Model.BusinessInvoice finalInvoice = result.ReturnValue as NFMT.Invoice.Model.BusinessInvoice;
                if (finalInvoice == null || finalInvoice.BusinessInvoiceId <= 0)
                    Response.Redirect(redirectUrl);

                this.curFinalInvoice = finalInvoice;

                //获取主发票
                NFMT.Operate.BLL.InvoiceBLL invoiceBLL = new NFMT.Operate.BLL.InvoiceBLL();
                result = invoiceBLL.Get(user, finalInvoice.InvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Operate.Model.Invoice invoice = result.ReturnValue as NFMT.Operate.Model.Invoice;
                if (invoice == null || invoice.InvoiceId <= 0)
                    Response.Redirect(redirectUrl);

                this.curInvoice = invoice;

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

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

                this.curContractSub = sub;

                //币种和计量单位
                NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                if (currency != null && currency.CurrencyId > 0)
                    this.currencyName = currency.CurrencyName;
                NFMT.Data.Model.MeasureUnit mu = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == sub.UnitId);
                if (mu != null && mu.MUId > 0)
                    this.curUnit = mu.MUName;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.Buy)
                    invoiceDirection = NFMT.Invoice.InvoiceDirectionEnum.收取;

                this.SelectJson(finalInvoice.BusinessInvoiceId);

                this.navigation1.Routes.Add("补零终票列表", redirectUrl);
                this.navigation1.Routes.Add("补零终票新增", string.Empty);

                this.contractExpander1.CurContract = contract;
                this.contractExpander1.CurContractSub = sub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
            this.curUser = user;

            string redirectUrl = string.Format("{0}WareHouse/StockInByContract.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.录入 });

                this.navigation1.Routes.Add("入库登记", string.Format("{0}WareHouse/StockInList.aspx", NFMT.Common.DefaultValue.NftmSiteName));
                this.navigation1.Routes.Add("合约入库", redirectUrl);
                this.navigation1.Routes.Add("入库登记新增", string.Empty);

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

                NFMT.User.UserSecurity security = user as NFMT.User.UserSecurity;
                this.curDeptId = security.Dept.DeptId;

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

                int id = 0;//子合约Id
                if (!int.TryParse(Request.QueryString["id"], out id) || id == 0)
                    Response.Redirect(redirectUrl);

                this.hidContractSubId.Value = id.ToString();

                NFMT.Contract.BLL.ContractSubBLL contractSubBLL = new NFMT.Contract.BLL.ContractSubBLL();
                NFMT.Common.ResultModel result = contractSubBLL.Get(user, id);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

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

                this.curSub = contractSub;

                int contractId = contractSub.ContractId;
                NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
                result = contractBLL.Get(user, contractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

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

                this.curContract = contract;

                this.hidAssetId.Value = contract.AssetId.ToString();
                this.hidMUId.Value = contract.UnitId.ToString();

                this.SubId = contractSub.SubId;

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

            }
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.VerificationUtility ver = new Utility.VerificationUtility();
            ver.JudgeOperate(this.Page, 37, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

            user = Utility.UserUtility.CurrentUser;
            string redirectUrl = "ContractOutStockList.aspx";

            this.navigation1.Routes.Add("合约列表", "ContractList.aspx");
            this.navigation1.Routes.Add("库存列表", redirectUrl);
            this.navigation1.Routes.Add("合约明细", string.Empty);

            int subId = 0;
            if (!string.IsNullOrEmpty(Request.QueryString["sid"]))
                int.TryParse(Request.QueryString["sid"], out subId);

            int contractId = 0;
            if (subId <= 0 && (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out contractId) || contractId <= 0))
                Utility.JsUtility.WarmAlert(this, "合约序号错误", redirectUrl);

            NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
            NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
            NFMT.Contract.BLL.ContractDetailBLL detailBLL = new NFMT.Contract.BLL.ContractDetailBLL();
            NFMT.Contract.BLL.ContractPriceBLL priceBLL = new NFMT.Contract.BLL.ContractPriceBLL();
            NFMT.Contract.BLL.ContractCorporationDetailBLL corpBLL = new NFMT.Contract.BLL.ContractCorporationDetailBLL();
            NFMT.Contract.BLL.ContractDeptBLL deptBLL = new NFMT.Contract.BLL.ContractDeptBLL();

            //主合约进入
            if (contractId > 0)
            {
                result = contractBLL.Get(user, contractId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this, "合约不存在", redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Utility.JsUtility.WarmAlert(this, "合约不存在", redirectUrl);

                if (contract.CreateFrom != (int)NFMT.Common.CreateFromEnum.销售合约库存创建)
                    Utility.JsUtility.WarmAlert(this, "合约创建来源不正确", redirectUrl);

                this.curContract = contract;

                result = subBLL.GetSubByContractId(user, contract.ContractId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this, "子合约获取失败", redirectUrl);

                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.SubId <= 0)
                    Utility.JsUtility.WarmAlert(this, "子合约获取失败", redirectUrl);

                this.curSub = sub;
            }
            else if (subId > 0)//子合约进入
            {
                result = subBLL.Get(user, subId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this, "子合约获取失败", redirectUrl);

                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.SubId <= 0)
                    Utility.JsUtility.WarmAlert(this, "子合约获取失败", redirectUrl);

                this.curSub = sub;

                result = contractBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this, "合约不存在", redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Utility.JsUtility.WarmAlert(this, "合约不存在", redirectUrl);

                if (contract.CreateFrom != (int)NFMT.Common.CreateFromEnum.销售合约库存创建)
                    Utility.JsUtility.WarmAlert(this, "合约创建来源不正确", redirectUrl);

                this.curContract = contract;
            }

            //获取合约品种
            NFMT.Data.Model.Asset asset = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == this.curContract.AssetId);
            if (asset == null || asset.AssetId <= 0)
                Utility.JsUtility.WarmAlert(this, "合约品种获取失败", redirectUrl);

            this.curAsset = asset;

            //获取明细
            result = detailBLL.GetDetailByContractId(user, this.curContract.ContractId);
            if (result.ResultStatus != 0)
                Utility.JsUtility.WarmAlert(this, "合约明细获取失败", redirectUrl);
            curContraceDetail = result.ReturnValue as NFMT.Contract.Model.ContractDetail;
            if (curContraceDetail == null)
                Utility.JsUtility.WarmAlert(this, "合约明细获取失败", redirectUrl);

            //获取价格
            result = priceBLL.GetPriceByContractId(user, this.curContract.ContractId);
            if (result.ResultStatus != 0)
                Utility.JsUtility.WarmAlert(this, "合约价格获取失败", redirectUrl);
            curContractPrice = result.ReturnValue as NFMT.Contract.Model.ContractPrice;
            if (curContractPrice == null)
                Utility.JsUtility.WarmAlert(this, "合约价格获取失败", redirectUrl);

            //获取公司列表
            //我方公司
            result = corpBLL.LoadCorpListByContractId(user, this.curContract.ContractId, true);
            if (result.ResultStatus != 0)
                Utility.JsUtility.WarmAlert(this, "合约我方抬头获取失败", redirectUrl);
            List<NFMT.Contract.Model.ContractCorporationDetail> inCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;
            if (inCorps == null || inCorps.Count == 0)
                Utility.JsUtility.WarmAlert(this, "合约我方抬头获取失败", redirectUrl);

            //对方公司
            result = corpBLL.LoadCorpListByContractId(user, this.curContract.ContractId, false);
            if (result.ResultStatus != 0)
                Utility.JsUtility.WarmAlert(this, "合约对方抬头获取失败", redirectUrl);
            List<NFMT.Contract.Model.ContractCorporationDetail> outCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>;
            if (outCorps == null || outCorps.Count == 0)
                Utility.JsUtility.WarmAlert(this, "合约对方抬头获取失败", redirectUrl);

            //执行部门
            result = deptBLL.LoadDeptByContractId(user, this.curContract.ContractId);
            if (result.ResultStatus != 0)
                Response.Redirect("ContractList.aspx");

            List<NFMT.Contract.Model.ContractDept> depts = result.ReturnValue as List<NFMT.Contract.Model.ContractDept>;

            foreach (var obj in outCorps)
            {
                if (outCorps.IndexOf(obj) > 0)
                    curOutCorpsString += ",";
                curOutCorpsString += obj.CorpId.ToString();
            }

            foreach (var obj in inCorps)
            {
                if (inCorps.IndexOf(obj) > 0)
                    this.curInCorpsString += ",";
                curInCorpsString += obj.CorpId.ToString();
            }

            foreach (var obj in depts)
            {
                if (depts.IndexOf(obj) > 0)
                    curDeptsString += ",";
                curDeptsString += obj.DeptId.ToString();
            }

            //合约类型
            NFMT.Contract.BLL.ContractTypeDetailBLL contractTypeBLL = new NFMT.Contract.BLL.ContractTypeDetailBLL();
            result = contractTypeBLL.LoadContractTypesById(user, this.curContract.ContractId);
            if (result.ResultStatus != 0)
                this.WarmAlert("合约类型获取失败", redirectUrl);
            List<NFMT.Contract.Model.ContractTypeDetail> contractTypes = result.ReturnValue as List<NFMT.Contract.Model.ContractTypeDetail>;
            if (contractTypes == null)
                this.WarmAlert("合约类型获取失败", redirectUrl);
            foreach (NFMT.Contract.Model.ContractTypeDetail contractType in contractTypes)
            {
                if (contractTypes.IndexOf(contractType) > 0)
                    this.curContractTypesString += ",";

                this.curContractTypesString += contractType.ContractType.ToString();
            }

            int pageIndex = 1;
            int pageSize = 100;
            string orderStr = string.Empty;
            NFMT.WareHouse.BLL.StockLogBLL stockLogBLL = new NFMT.WareHouse.BLL.StockLogBLL();
            NFMT.Common.SelectModel select = stockLogBLL.GetContractOutStockSelect(pageIndex, pageSize, orderStr, this.curSub.SubId);
            result = stockLogBLL.Load(user, select, NFMT.Common.DefaultValue.ClearAuth);
            System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
            this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

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

            this.attach1.BusinessIdValue = this.curContract.ContractId;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "InvoiceDirectFinalList.aspx";

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

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

                //获取合约与子合约
                int subId = 0;
                if(string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"],out subId))
                    Response.Redirect(redirectUrl);

                NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBLL.Get(user, subId);
                if(result.ResultStatus!=0)
                    Response.Redirect(redirectUrl);

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

                this.curContractSub = sub;

                NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                if (currency != null && currency.CurrencyId > 0)
                    this.currencyName = currency.CurrencyName;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if(result.ResultStatus!=0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if(contract == null || contract.ContractId<=0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                if (contract.TradeDirection ==(int)NFMT.Contract.TradeDirectionEnum.Buy)
                    invoiceDirection = NFMT.Invoice.InvoiceDirectionEnum.收取;

                //获取子合约价格明细
                NFMT.Contract.BLL.SubPriceBLL subPriceBLL = new NFMT.Contract.BLL.SubPriceBLL();
                result = subPriceBLL.GetPriceBySubId(user, sub.SubId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.SubPrice subPrice = result.ReturnValue as NFMT.Contract.Model.SubPrice;
                if(subPrice == null || subPrice.SubPriceId<=0)
                    Response.Redirect(redirectUrl);

                if (sub.PriceMode == (int)NFMT.Contract.PriceModeEnum.Pricing)
                {
                    //定价合约
                    this.AvgPrice = subPrice.FixedPrice.ToString("0.0000");
                }
                else if ((subPrice.WhoDoPrice == (int)NFMT.Contract.WhoDoPriceEnum.我方 && contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.采购) || contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.销售)
                {
                    //点价合约
                    //获取当前子合约下点价列表
                    NFMT.DoPrice.BLL.PricingBLL pricingBLL = new NFMT.DoPrice.BLL.PricingBLL();
                    result = pricingBLL.Load(user, sub.SubId);
                    if (result.ResultStatus != 0)
                    {
                        Response.Write("<script>");
                        Response.Write("alert(\"该合约未进行任何点价,不能开具或收取直接终票\");");
                        Response.Write(string.Format("document.local.href={0};",redirectUrl));
                        Response.Write("</script>");
                        Response.End();
                    }

                    List<NFMT.DoPrice.Model.Pricing> pricings = result.ReturnValue as List<NFMT.DoPrice.Model.Pricing>;
                    if (pricings == null || pricings.Count <= 0)
                    {
                        Response.Write("<script>");
                        Response.Write("alert(\"该合约未进行任何点价,不能开具或收取直接终票\");");
                        Response.Write(string.Format("document.location.href =\"{0}\";", redirectUrl));
                        Response.Write("</script>");
                        Response.End();
                    }
                    decimal sumBala = pricings.Sum(temp => temp.FinalPrice * temp.PricingWeight);
                    decimal sumAmount = pricings.Sum(temp => temp.PricingWeight);

                    decimal avgPrice = sumBala / sumAmount;
                    this.AvgPrice = avgPrice.ToString("0.0000");
                }

                this.SelectJson(sub.SubId, invoiceDirection);

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId);
                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

                this.navigation1.Routes.Add("直接终票列表", redirectUrl);
                this.navigation1.Routes.Add(string.Format("直接终票新增", invoiceDirection), string.Empty);

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curContractSub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 57, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 });

                string redirectUrl = "CashInAllotList.aspx";
                this.navigation1.Routes.Add("收款分配列表",redirectUrl);
                this.navigation1.Routes.Add("合约收款分配新增", string.Empty);

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

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

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

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

                this.curSub = sub;

                //获取合约
                NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
                result = contractBLL.Get(user, sub.ContractId);

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

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                #region 赋值
                //合约信息
                this.spnContractNo.InnerHtml = contract.ContractNo;
                this.spnAsset.InnerHtml = NFMT.Data.BasicDataProvider.Assets.First(temp => temp.AssetId == contract.AssetId).AssetName;
                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId);
                this.spnSignAmount.InnerHtml = string.Format("{0}{1}", contract.SignAmount.ToString(), muContract.MUName);

                //合约抬头
                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);
                }

                //子合约信息
                this.spnSubNo.InnerHtml = sub.SubNo;

                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.SingleOrDefault(temp => temp.MUId == sub.UnitId);
                if (muSub != null && muSub.MUId > 0)
                    this.spnSubSignAmount.InnerHtml = string.Format("{0}{1}", sub.SignAmount.ToString(), muSub.MUName);
                this.spnPeriodE.InnerHtml = sub.ContractPeriodE.ToShortDateString();

                #endregion

                result = subBLL.GetContractOutCorp(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                if (dt == null || dt.Rows.Count == 0)
                    Response.Redirect(redirectUrl);

                for (int i=0; i< dt.Rows.Count;i++)
                {
                    System.Data.DataRow dr = dt.Rows[i];

                    if (dr["CorpId"] != DBNull.Value)
                    {
                        if (i != 0)
                            this.curOutCorpIds += ",";

                        this.curOutCorpIds += dr["CorpId"].ToString();
                    }
                }

                this.JsonOutCorp = Newtonsoft.Json.JsonConvert.SerializeObject(result.ReturnValue);

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = string.Format("{0}DoPrice/PricingApplyDelayList.aspx", NFMT.Common.DefaultValue.NftmSiteName);
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 105, 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);

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

                //获取合约与子合约
                int subId = 0;

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

                NFMT.DoPrice.BLL.PricingApplyDelayBLL pricingApplyDelayBLL = new NFMT.DoPrice.BLL.PricingApplyDelayBLL();
                result = pricingApplyDelayBLL.Get(user, delayId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                pricingApplyDelay = result.ReturnValue as NFMT.DoPrice.Model.PricingApplyDelay;
                if (pricingApplyDelay == null)
                    Response.Redirect(redirectUrl);

                pricingApplyId = pricingApplyDelay.PricingApplyId;

                NFMT.DoPrice.BLL.PricingApplyBLL pricingApplyBLL = new NFMT.DoPrice.BLL.PricingApplyBLL();
                result = pricingApplyBLL.Get(user, pricingApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                 pricingApply = result.ReturnValue as NFMT.DoPrice.Model.PricingApply;
                if (pricingApply == null)
                    Response.Redirect(redirectUrl);

                subId = pricingApply.SubContractId;

                NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = applyBLL.Get(user, pricingApply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                apply = result.ReturnValue as NFMT.Operate.Model.Apply;
                if (apply == null)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBLL.Get(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

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

                this.curContractSub = sub;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                currencyId = curContract.SettleCurrency;
                assetId = curContract.AssetId;
                mUId = curContract.UnitId;

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId);
                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

                result = pricingApplyBLL.GetAlreadyPricingWeight(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                alreadyPricingWeight = Convert.ToDecimal(result.ReturnValue.ToString());

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

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curContractSub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.VerificationUtility ver = new Utility.VerificationUtility();
            ver.JudgeOperate(this.Page, 79, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            this.hidTradeDirection.Value = ((int)NFMT.Data.StyleEnum.TradeDirection).ToString();
            this.hidTradeBorder.Value = ((int)NFMT.Data.StyleEnum.TradeBorder).ToString();
            this.hidMarginMode.Value = ((int)NFMT.Data.StyleEnum.MarginMode).ToString();
            this.hidValueRateType.Value = ((int)NFMT.Data.StyleEnum.ValueRateType).ToString();
            this.hidDiscountBase.Value = ((int)NFMT.Data.StyleEnum.DiscountBase).ToString();
            this.hidWhoDoPrice.Value = ((int)NFMT.Data.StyleEnum.WhoDoPrice).ToString();
            this.hidSummaryPrice.Value = ((int)NFMT.Data.StyleEnum.SummaryPrice).ToString();

            string redirectUrl = "SubList.aspx";

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

            this.navigation1.Routes.Add("子合约列表", redirectUrl);
            this.navigation1.Routes.Add("子合约修改", string.Empty);

            this.hidTradeDirection.Value = ((int)NFMT.Data.StyleEnum.TradeDirection).ToString();
            this.hidTradeBorder.Value = ((int)NFMT.Data.StyleEnum.TradeBorder).ToString();
            this.hidMarginMode.Value = ((int)NFMT.Data.StyleEnum.MarginMode).ToString();
            this.hidValueRateType.Value = ((int)NFMT.Data.StyleEnum.ValueRateType).ToString();
            this.hidDiscountBase.Value = ((int)NFMT.Data.StyleEnum.DiscountBase).ToString();
            this.hidWhoDoPrice.Value = ((int)NFMT.Data.StyleEnum.WhoDoPrice).ToString();
            this.hidSummaryPrice.Value = ((int)NFMT.Data.StyleEnum.SummaryPrice).ToString();

            NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
            NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
            NFMT.Contract.BLL.SubDetailBLL detailBLL = new NFMT.Contract.BLL.SubDetailBLL();
            NFMT.Contract.BLL.SubPriceBLL priceBLL = new NFMT.Contract.BLL.SubPriceBLL();
            NFMT.Contract.BLL.SubCorporationDetailBLL corpBLL = new NFMT.Contract.BLL.SubCorporationDetailBLL();
            NFMT.Contract.BLL.ContractDeptBLL deptBLL = new NFMT.Contract.BLL.ContractDeptBLL();

            //获取子合约
            NFMT.Common.ResultModel result = subBLL.Get(user, subId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirectUrl);

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

            int contractId = this.curSub.ContractId;

            //获取合约
            result = contractBLL.Get(user, contractId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirectUrl);
            curContract = result.ReturnValue as NFMT.Contract.Model.Contract;
            if (curContract == null)
                Response.Redirect(redirectUrl);

            //获取明细
            result = detailBLL.GetDetailBySubId(user, subId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirectUrl);
            this.curSubDetail = result.ReturnValue as NFMT.Contract.Model.SubDetail;
            if (curSubDetail == null)
                Response.Redirect(redirectUrl);

            //获取价格
            result = priceBLL.GetPriceBySubId(user, subId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirectUrl);
            curSubPrice = result.ReturnValue as NFMT.Contract.Model.SubPrice;
            if (curSubPrice == null)
                Response.Redirect(redirectUrl);

            //获取公司列表
            //我方公司
            result = corpBLL.Load(user, subId, true);
            if (result.ResultStatus != 0)
                Response.Redirect(redirectUrl);
            curInCorps = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
            if (curInCorps == null || curInCorps.Count == 0)
                Response.Redirect(redirectUrl);

            //对方公司
            result = corpBLL.Load(user, subId, false);
            if (result.ResultStatus != 0)
                Response.Redirect(redirectUrl);
            curOutCorps = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
            if (curOutCorps == null || curOutCorps.Count == 0)
                Response.Redirect(redirectUrl);

            //执行部门
            result = deptBLL.LoadDeptByContractId(user, contractId);
            if (result.ResultStatus != 0)
                Response.Redirect(redirectUrl);

            curDepts = result.ReturnValue as List<NFMT.Contract.Model.ContractDept>;

            foreach (var obj in curOutCorps)
            {
                if (curOutCorps.IndexOf(obj) > 0)
                    curOutCorpsString += ",";
                curOutCorpsString += obj.CorpId.ToString();
            }

            foreach (var obj in this.curInCorps)
            {
                if (curInCorps.IndexOf(obj) > 0)
                    this.curInCorpsString += ",";
                curInCorpsString += obj.CorpId.ToString();
            }

            foreach (var obj in this.curDepts)
            {
                if (curDepts.IndexOf(obj) > 0)
                    curDeptsString += ",";
                curDeptsString += obj.DeptId.ToString();
            }

            //attach
            this.attach1.BusinessIdValue = this.curSub.SubId;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "InvoiceDirectFinalList.aspx";

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

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

                int invoiceId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["iid"]) || !int.TryParse(Request.QueryString["iid"], out invoiceId))
                    invoiceId = 0;

                //获取直接终票
                int businessInvoiceId = 0;
                if (invoiceId == 0 && (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out businessInvoiceId)))
                    Response.Redirect(redirectUrl);
                NFMT.Invoice.BLL.BusinessInvoiceBLL businessInvoiceBLL = new NFMT.Invoice.BLL.BusinessInvoiceBLL();

                if (invoiceId > 0)
                    result = businessInvoiceBLL.GetByInvoiceId(user, invoiceId);
                else
                    result = businessInvoiceBLL.Get(user, businessInvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Invoice.Model.BusinessInvoice businessInvoice = result.ReturnValue as NFMT.Invoice.Model.BusinessInvoice;
                if (businessInvoice == null || businessInvoice.BusinessInvoiceId <= 0)
                    Response.Redirect(redirectUrl);

                this.curBusinessInvoice = businessInvoice;

                //获取发票主体
                NFMT.Operate.BLL.InvoiceBLL invoiceBLL = new NFMT.Operate.BLL.InvoiceBLL();
                result = invoiceBLL.Get(user, businessInvoice.InvoiceId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Operate.Model.Invoice invoice = result.ReturnValue as NFMT.Operate.Model.Invoice;
                if (invoice == null || invoice.InvoiceId <= 0)
                    Response.Redirect(redirectUrl);

                this.curInvoice = invoice;

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

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

                this.curContractSub = sub;

                NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                if (currency != null && currency.CurrencyId > 0)
                    this.currencyName = currency.CurrencyName;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.Buy)
                    invoiceDirection = NFMT.Invoice.InvoiceDirectionEnum.收取;

                this.SelectJson(businessInvoice, invoiceDirection);

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId);
                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

                this.navigation1.Routes.Add("直接终票列表", redirectUrl);
                this.navigation1.Routes.Add(string.Format("直接终票明细", invoiceDirection), string.Empty);

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

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curContractSub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "StockOutApplyList.aspx";

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

                this.navigation1.Routes.Add("出库申请列表", redirectUrl);
                this.navigation1.Routes.Add("出库申请修改", string.Empty);

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

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

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

                //获取出库申请
                NFMT.WareHouse.BLL.StockOutApplyBLL stockOutApplyBLL = new NFMT.WareHouse.BLL.StockOutApplyBLL();
                NFMT.Common.ResultModel result = stockOutApplyBLL.Get(user, stockOutApplyId);
                if(result.ResultStatus!=0)
                    Response.Redirect(redirectUrl);
                NFMT.WareHouse.Model.StockOutApply apply = result.ReturnValue as NFMT.WareHouse.Model.StockOutApply;
                if(apply==null || apply.ApplyId==0)
                    Response.Redirect(redirectUrl);

                this.curStockOutApply = apply;

                //获取关联子合约
                NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBll.Get(user, apply.SubContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.ContractId == 0)
                    Response.Redirect(redirectUrl);

                this.curSub = sub;
                this.curCurrency = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);

                //获取关联合约
                NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL();
                result = bll.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.Contract con = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (con == null || con.ContractId == 0)
                    Response.Redirect(redirectUrl);

                this.curContract = con;
                this.curAsset = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == con.AssetId);
                this.curUint = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == sub.UnitId);

                //获取主申请信息
                NFMT.Operate.BLL.ApplyBLL mainApplyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = mainApplyBLL.Get(user, apply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Operate.Model.Apply mainApply = result.ReturnValue as NFMT.Operate.Model.Apply;
                if(mainApply==null || mainApply.ApplyId<=0)
                    Response.Redirect(redirectUrl);

                if(mainApply.ApplyStatus >=NFMT.Common.StatusEnum.待审核)
                    Response.Redirect(redirectUrl);

                this.txbMemo.Value = mainApply.ApplyDesc;
                this.curApply = mainApply;

                //获取当前出库申请明细
                //NFMT.WareHouse.BLL.StockOutApplyDetailBLL detailBLL = new NFMT.WareHouse.BLL.StockOutApplyDetailBLL();
                //result = detailBLL.Load(user, apply.StockOutApplyId);
                //if(result.ResultStatus!=0)
                //    Response.Redirect(redirectUrl);

                //List<NFMT.WareHouse.Model.StockOutApplyDetail> details = result.ReturnValue as List<NFMT.WareHouse.Model.StockOutApplyDetail>;
                //if(details==null)
                //    Response.Redirect(redirectUrl);

                NFMT.Common.SelectModel select = stockOutApplyBLL.GetOutApplySelectedSelect(1, 100, "sto.StockId desc",string.Empty,curStockOutApply.StockOutApplyId);
                result = stockOutApplyBLL.Load(user, select);
                int totalRows = result.AffectCount;
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.JsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

                this.contractExpander1.CurContract = con;
                this.contractExpander1.CurContractSub = sub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = string.Format("{0}DoPrice/PriceConfirmList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

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

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

                this.navigation1.Routes.Add("价格确认单列表", redirectUrl);
                this.navigation1.Routes.Add("价格确认单明细", string.Empty);

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

                NFMT.DoPrice.BLL.PriceConfirmBLL priceConfirmBLL = new NFMT.DoPrice.BLL.PriceConfirmBLL();
                result = priceConfirmBLL.Get(user, priceConfirmId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                priceConfirm = result.ReturnValue as NFMT.DoPrice.Model.PriceConfirm;
                if (priceConfirm == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取价格确认单失败", redirectUrl);

                int subId = priceConfirm.SubId;

                //获取子合约
                NFMT.Contract.BLL.ContractSubBLL contractSubBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = contractSubBLL.Get(user, subId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.SubId <= 0)
                    Utility.JsUtility.WarmAlert(this.Page, "获取子合约失败", redirectUrl);

                NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
                result = contractBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                //获取合约
                contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取合约失败", redirectUrl);

                this.txbContractNo.Value = contract.OutContractNo;

                if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.采购)
                    strTradeDirection = "采购";
                else if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.销售)
                    strTradeDirection = "销售";
                else
                    strTradeDirection = string.Empty;

                this.txbTradeDirection.Value = strTradeDirection;

                //获取子合约中的币种
                cur = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(a => a.CurrencyId == sub.SettleCurrency);
                if (cur == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取币种失败", redirectUrl);

                //获取合约单位
                mu = NFMT.Data.BasicDataProvider.MeasureUnits.SingleOrDefault(a => a.MUId == sub.UnitId);
                if (mu == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取单位失败", redirectUrl);

                //获取合约抬头
                //我方
                NFMT.Contract.BLL.SubCorporationDetailBLL subCorporationDetailBLL = new NFMT.Contract.BLL.SubCorporationDetailBLL();
                result = subCorporationDetailBLL.Load(user, subId, true);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                subInCorpDetails = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
                if (subInCorpDetails == null || !subInCorpDetails.Any())
                    Utility.JsUtility.WarmAlert(this.Page, "获取我方抬头失败", redirectUrl);

                this.txbInCorpId.Value = subInCorpDetails.SingleOrDefault(a => a.IsDefaultCorp == true).CorpName;

                //对方
                result = subCorporationDetailBLL.Load(user, subId, false);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                subOutCorpDetails = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
                if (subInCorpDetails == null || !subInCorpDetails.Any())
                    Utility.JsUtility.WarmAlert(this.Page, "获取我方抬头失败", redirectUrl);

                this.txbOutCorpId.Value = subOutCorpDetails.SingleOrDefault(a => a.IsDefaultCorp == true).CorpName;

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

                SelectJson(sub.SubId, priceConfirmId);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 57, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.执行完成, NFMT.Common.OperateEnum.执行完成撤销 });
                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

                string redirectUrl = "CashInAllotList.aspx";
                this.navigation1.Routes.Add("收款分配列表", redirectUrl);
                this.navigation1.Routes.Add("合约收款分配修改", string.Empty);

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

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

                NFMT.Funds.BLL.CashInAllotBLL cashInAllotBLL = new NFMT.Funds.BLL.CashInAllotBLL();
                result = cashInAllotBLL.Get(user, allotId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                cashInAllot = result.ReturnValue as NFMT.Funds.Model.CashInAllot;
                if (cashInAllot == null || cashInAllot.AllotId <= 0)
                    Response.Redirect(redirectUrl);

                //获取合约分配明细
                NFMT.Funds.BLL.CashInContractBLL cashInContractBLL = new NFMT.Funds.BLL.CashInContractBLL();
                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.已关闭;

                result = cashInContractBLL.GetByAllot(user, allotId, status);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Funds.Model.CashInContract cashInContract = result.ReturnValue as NFMT.Funds.Model.CashInContract;
                if (cashInContract == null || cashInContract.RefId == 0)
                    Response.Redirect(redirectUrl);

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

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

                this.curSub = sub;

                //获取合约
                NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
                result = contractBLL.Get(user, sub.ContractId);

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

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                #region 赋值
                //合约信息
                this.spnContractNo.InnerHtml = contract.ContractNo;
                this.spnAsset.InnerHtml = NFMT.Data.BasicDataProvider.Assets.First(temp => temp.AssetId == contract.AssetId).AssetName;
                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId);
                this.spnSignAmount.InnerHtml = string.Format("{0}{1}", contract.SignAmount.ToString(), muContract.MUName);

                //合约抬头
                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);
                }

                //子合约信息
                this.spnSubNo.InnerHtml = sub.SubNo;

                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.SingleOrDefault(temp => temp.MUId == sub.UnitId);
                if (muSub != null && muSub.MUId > 0)
                    this.spnSubSignAmount.InnerHtml = string.Format("{0}{1}", sub.SignAmount.ToString(), muSub.MUName);
                this.spnPeriodE.InnerHtml = sub.ContractPeriodE.ToShortDateString();

                #endregion

                NFMT.Funds.BLL.CashInContractBLL bll = new NFMT.Funds.BLL.CashInContractBLL();
                NFMT.Common.SelectModel select = bll.GetCurDetailsSelect(1, 100, "cicr.RefId desc", sub.SubId, status);
                result = bll.Load(user, select);

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

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

                string json = serializer.Serialize(cashInAllot);
                this.hidModel.Value = json;
            }
        }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 120, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

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

                string redirectUrl = "InterestList.aspx";
                this.navigation1.Routes.Add("利息结算列表", redirectUrl);
                this.navigation1.Routes.Add("利息结算明细", string.Empty);

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

                //获取当前结息
                NFMT.DoPrice.BLL.InterestBLL interestBLL = new NFMT.DoPrice.BLL.InterestBLL();
                result = interestBLL.Get(user, interestId);
                if (result.ResultStatus != 0)
                    this.WarmAlert(result.Message, redirectUrl);

                NFMT.DoPrice.Model.Interest interest = result.ReturnValue as NFMT.DoPrice.Model.Interest;
                if (interest == null || interest.Id <= 0)
                    this.WarmAlert("利息结算不存在", redirectUrl);

                this.curInterest = interest;

                //获取币种
                NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == interest.CurrencyId);
                if (currency == null || currency.CurrencyId <= 0)
                    this.WarmAlert("币种不存在", redirectUrl);

                this.curCurrency = currency;

                //获取重量单位
                NFMT.Data.Model.MeasureUnit measureUnit = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == interest.Unit);
                if (measureUnit == null || measureUnit.MUId <= 0)
                    this.WarmAlert("重量单位不存在", redirectUrl);

                this.curMeasureUnit = measureUnit;

                //获取子合约
                NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBLL.Get(user, interest.SubContractId);
                if (result.ResultStatus != 0)
                    this.WarmAlert("子合约不存在", redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.SubId <= 0)
                    this.WarmAlert("子合约不存在", redirectUrl);

                this.curSub = sub;

                //品种
                NFMT.Data.Model.Asset asset = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == sub.AssetId);
                if (asset == null || asset.AssetId <= 0)
                    this.WarmAlert("品种获取失败", redirectUrl);

                this.curAsset = asset;

                NFMT.Contract.TradeDirectionEnum tradeDirection = (NFMT.Contract.TradeDirectionEnum)sub.TradeDirection;
                this.curTradeDirection = tradeDirection;

                NFMT.Contract.BLL.SubCorporationDetailBLL corpBLL = new NFMT.Contract.BLL.SubCorporationDetailBLL();
                //我方公司
                result = corpBLL.Load(user, sub.SubId, true);
                if (result.ResultStatus != 0)
                    this.WarmAlert("我方公司获取失败", redirectUrl);

                List<NFMT.Contract.Model.SubCorporationDetail> inCorps = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
                if (inCorps == null || inCorps.Count == 0)
                    this.WarmAlert("我方公司获取失败", redirectUrl);

                NFMT.Contract.Model.SubCorporationDetail inCorp = inCorps.FirstOrDefault(temp => temp.IsDefaultCorp);
                if (inCorp == null || inCorp.CorpId <= 0)
                    this.WarmAlert("我方公司获取失败", redirectUrl);

                this.curInCorp = inCorp;

                //对方公司
                result = corpBLL.Load(user, sub.SubId, false);
                if (result.ResultStatus != 0)
                    this.WarmAlert("对方公司获取失败", redirectUrl);

                List<NFMT.Contract.Model.SubCorporationDetail> outCorps = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
                if (outCorps == null || outCorps.Count == 0)
                    this.WarmAlert("对方公司获取失败", redirectUrl);

                NFMT.Contract.Model.SubCorporationDetail outCorp = outCorps.FirstOrDefault(temp => temp.IsDefaultCorp);
                if (outCorp == null || outCorp.CorpId <= 0)
                    this.WarmAlert("对方公司获取失败", redirectUrl);

                this.curOutCorp = outCorp;

                //json
                int pageIndex = 1, pageSize = 100;
                string orderStr = string.Empty, whereStr = string.Empty;
                NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();

                select = interestBLL.GetCurDetailsSelect(pageIndex, pageSize, orderStr, sub.SubId, interest.InterestId);
                result = interestBLL.Load(user, select, NFMT.Common.DefaultValue.ClearAuth);
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.curJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                string json = serializer.Serialize(interest);
                this.hidModel.Value = json;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "InvoiceDirectFinalList.aspx";

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

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

                //获取合约与子合约
                int subId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out subId))
                    Response.Redirect(redirectUrl);

                NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBLL.Get(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

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

                this.curContractSub = sub;

                NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                if (currency != null && currency.CurrencyId > 0)
                    this.currencyName = currency.CurrencyName;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.Buy)
                    invoiceDirection = NFMT.Invoice.InvoiceDirectionEnum.收取;

                int pageIndex = 1, pageSize = 100;
                string orderStr = string.Empty, whereStr = string.Empty;
                NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
                NFMT.Invoice.BLL.BusinessInvoiceBLL bll = new NFMT.Invoice.BLL.BusinessInvoiceBLL();

                if (sub.PriceMode == (int)NFMT.Contract.PriceModeEnum.定价)
                {
                    //定价合约

                    //获取子合约价格明细
                    NFMT.Contract.BLL.SubPriceBLL subPriceBLL = new NFMT.Contract.BLL.SubPriceBLL();
                    result = subPriceBLL.GetPriceBySubId(user, sub.SubId);
                    if (result.ResultStatus != 0)
                        Response.Redirect(redirectUrl);

                    NFMT.Contract.Model.SubPrice subPrice = result.ReturnValue as NFMT.Contract.Model.SubPrice;
                    if (subPrice == null || subPrice.SubPriceId <= 0)
                        Response.Redirect(redirectUrl);
                    this.AvgPrice = subPrice.FixedPrice;
                    select = bll.GetDirectFinalStocksSelect(pageIndex, pageSize, orderStr, subId, 0, false, false);
                }
                else
                {
                    select = bll.GetDirectStocksModel(pageIndex, pageSize, orderStr, subId, false, 0);
                }

                result = bll.Load(user, select, NFMT.Common.DefaultValue.ClearAuth);
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.SelectedJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

                //if (sub.PriceMode == (int)NFMT.Contract.PriceModeEnum.点价)
                //{
                    decimal sumBala = dt.Select().Sum(temp => Convert.ToDecimal(temp["Bala"]));
                    decimal sumNetAmount = dt.Select().Sum(temp => Convert.ToDecimal(temp["NetAmount"]));

                    if (sumNetAmount == 0)
                        this.WarmAlert("未确认价格,禁止开终票", redirectUrl);
                if (sumNetAmount > 0)
                {
                    this.netAmount = sumNetAmount;
                    this.invoiceBala = Math.Round(sumBala, 2, MidpointRounding.AwayFromZero);
                    this.AvgPrice = Math.Round(this.invoiceBala/sumNetAmount, 4, MidpointRounding.AwayFromZero);
                }
                //}

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId);
                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

                this.navigation1.Routes.Add("直接终票列表", redirectUrl);
                this.navigation1.Routes.Add(string.Format("直接终票新增", invoiceDirection), string.Empty);

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curContractSub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "StockOutApplyList.aspx";

            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 43, 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 applyId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["aid"]) || !int.TryParse(Request.QueryString["aid"], out applyId))
                    applyId = 0;

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

                int stockOutApplyId = 0;
                if (applyId == 0 &&  !int.TryParse(Request.QueryString["id"], out stockOutApplyId))
                    Response.Redirect(redirectUrl);

                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

                //获取出库申请
                NFMT.WareHouse.BLL.StockOutApplyBLL stockOutApplyBLL = new NFMT.WareHouse.BLL.StockOutApplyBLL();
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
                if(applyId>0)
                    result = stockOutApplyBLL.GetByApplyId(user, applyId);
                else
                    result = stockOutApplyBLL.Get(user, stockOutApplyId);

                if(result.ResultStatus!=0)
                    Response.Redirect(redirectUrl);
                NFMT.WareHouse.Model.StockOutApply apply = result.ReturnValue as NFMT.WareHouse.Model.StockOutApply;
                if(apply==null || apply.ApplyId==0)
                    Response.Redirect(redirectUrl);

                stockOutApplyId = apply.StockOutApplyId;

                //获取主申请表信息
                NFMT.Operate.BLL.ApplyBLL mainApplyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = mainApplyBLL.Get(user, apply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                mainApply = result.ReturnValue as NFMT.Operate.Model.Apply;
                if (mainApply == null || mainApply.ApplyId <= 0)
                    Response.Redirect(redirectUrl);

                //获取关联子合约
                NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBll.Get(user, apply.SubContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.ContractId == 0)
                    Response.Redirect(redirectUrl);

                //获取关联合约
                NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL();
                result = bll.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.Contract con = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (con == null || con.ContractId == 0)
                    Response.Redirect(redirectUrl);

                this.curAsset = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == con.AssetId);
                this.curUint = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == con.UnitId);
                this.curApply = mainApply;
                this.curContract = con;
                this.curSub = sub;
                this.curCurrency = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                this.curStockOutApply = apply;

                NFMT.Data.Model.MeasureUnit subMU = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == sub.UnitId);
                this.txbMemo.Value = mainApply.ApplyDesc;

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

                NFMT.Common.SelectModel select = stockOutApplyBLL.GetOutApplySelectedSelect(1, 100, "sto.StockId desc", string.Empty, curStockOutApply.StockOutApplyId);
                result = stockOutApplyBLL.Load(user, select);
                int totalRows = result.AffectCount;
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.JsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

                this.contractExpander1.CurContract = con;
                this.contractExpander1.CurContractSub = sub;
                this.contractExpander1.RedirectUrl = redirectUrl;

                result = stockOutApplyBLL.GetAuditInfo(user, apply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect("StockOutApplyList.aspx");

                this.txbAuditInfo.InnerHtml = result.ReturnValue.ToString();
            }
        }
示例#19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                this.curUser = user;

                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                string redirectUrl = "OrderList.aspx";
                this.navigation1.Routes.Add("制单指令列表", redirectUrl);
                this.navigation1.Routes.Add("制单指令修改", string.Empty);

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

                //获取制单指令
                NFMT.Document.BLL.DocumentOrderBLL orderBLL = new NFMT.Document.BLL.DocumentOrderBLL();
                result = orderBLL.Get(user, orderId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Document.Model.DocumentOrder order = result.ReturnValue as NFMT.Document.Model.DocumentOrder;
                if (order == null || order.OrderId <= 0)
                    Response.Redirect(redirectUrl);

                this.curOrder = order;

                NFMT.Document.BLL.DocumentOrderDetailBLL detailBLL = new NFMT.Document.BLL.DocumentOrderDetailBLL();
                result = detailBLL.GetByOrderId(user, order.OrderId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Document.Model.DocumentOrderDetail orderDetail = result.ReturnValue as NFMT.Document.Model.DocumentOrderDetail;
                if (orderDetail == null || orderDetail.DetailId <= 0)
                    Response.Redirect(redirectUrl);

                this.curOrderDetail = orderDetail;

                NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBll.Get(user, order.SubId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.ContractId == 0)
                    Response.Redirect(redirectUrl);
                this.curSub = sub;

                NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL();
                result = bll.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract con = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (con == null || con.ContractId == 0)
                    Response.Redirect(redirectUrl);
                this.curContract = con;

                NFMT.Data.Model.Asset ass = NFMT.Data.BasicDataProvider.Assets.First(temp => temp.AssetId == con.AssetId);
                this.curAsset = ass;

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == con.UnitId);
                this.curUnit = muContract;

                NFMT.Data.Model.Currency cur = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                this.curCurrency = cur;

                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curSub;
                this.contractExpander1.RedirectUrl = redirectUrl;

                NFMT.Common.SelectModel select = orderBLL.GetNoStockOrderSelect(1, 100, "dos.DetailId desc", order.OrderId);
                result = orderBLL.Load(user, select);
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                if (dt != null)
                {
                    foreach (System.Data.DataRow dr in dt.Rows)
                    {
                        if (ass != null)
                            dr["AssetName"] = ass.AssetName;
                        if (muSub != null)
                            dr["MUName"] = muSub.MUName;
                    }
                }

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

                //attach
                this.attach1.BusinessIdValue = this.curOrder.OrderId;
            }
        }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = string.Format("{0}DoPrice/PricingApplyList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

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

                this.hidSummaryPrice.Value = ((int)NFMT.Data.StyleEnum.SummaryPrice).ToString();

                this.navigation1.Routes.Add("点价申请", redirectUrl);
                this.navigation1.Routes.Add("点价申请修改", string.Empty);

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

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

                NFMT.DoPrice.BLL.PricingApplyBLL pricingApplyBLL = new NFMT.DoPrice.BLL.PricingApplyBLL();
                //获取点价申请
                result = pricingApplyBLL.Get(user, pricingApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                pricingApply = result.ReturnValue as NFMT.DoPrice.Model.PricingApply;
                if (pricingApply == null || pricingApply.PricingApplyId <= 0)
                    Response.Redirect(redirectUrl);

                int subId = pricingApply.SubContractId;

                //获取申请
                NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = applyBLL.Get(user, pricingApply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                apply = result.ReturnValue as NFMT.Operate.Model.Apply;
                if (apply == null || apply.ApplyId <= 0)
                    Response.Redirect(redirectUrl);

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

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

                this.curContractSub = sub;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                currencyId = curContract.SettleCurrency;
                assetId = curContract.AssetId;
                mUId = curContract.UnitId;

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId);
                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

                result = pricingApplyBLL.GetAlreadyPricingWeight(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                alreadyPricingWeight = Convert.ToDecimal(result.ReturnValue.ToString());

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curContractSub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
示例#21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.VerificationUtility ver = new Utility.VerificationUtility();
            ver.JudgeOperate(this.Page, 52, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

            if (!IsPostBack)
            {
                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;
                this.curUser = user;

                this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项;
                this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode;

                string redirectUrl = "PayApplyList.aspx";

                this.navigation1.Routes.Add("付款申请列表", redirectUrl);
                this.navigation1.Routes.Add("付款申请修改", string.Empty);

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

                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

                //获取出库申请
                NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL();
                if (applyId > 0)
                    result = payApplyBLL.GetByApplyId(user, applyId);
                else
                    result = payApplyBLL.Get(user, payApplyId);

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

                NFMT.Funds.Model.PayApply payApply = result.ReturnValue as NFMT.Funds.Model.PayApply;
                if (payApply == null || payApply.PayApplyId <= 0)
                    Response.Redirect(redirectUrl);

                this.curPayApply = payApply;

                //获取主申请
                NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = applyBLL.Get(user, payApply.ApplyId);
                if(result.ResultStatus!=0)
                    Response.Redirect(redirectUrl);

                NFMT.Operate.Model.Apply apply = result.ReturnValue as NFMT.Operate.Model.Apply;
                if(apply == null || apply.ApplyId<=0)
                    Response.Redirect(redirectUrl);

                this.curApply = apply;

                //获取合约付款申请
                NFMT.Funds.BLL.ContractPayApplyBLL contractPayApplyBLL = new NFMT.Funds.BLL.ContractPayApplyBLL();
                result = contractPayApplyBLL.GetByPayApplyId(user, payApply.PayApplyId);
                if(result.ResultStatus!=0)
                    Response.Redirect(redirectUrl);

                NFMT.Funds.Model.ContractPayApply contractPayApply = result.ReturnValue as NFMT.Funds.Model.ContractPayApply;
                if(contractPayApply == null || contractPayApply.RefId<=0)
                    Response.Redirect(redirectUrl);

                //获取子合约
                NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBll.Get(user, contractPayApply.ContractSubId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.ContractId == 0)
                    Response.Redirect(redirectUrl);

                this.curSub = sub;

                //合约
                NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL();
                result = bll.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId == 0)
                    Response.Redirect(redirectUrl);

                this.contractExpander1.CurContract = contract;
                this.contractExpander1.CurContractSub = sub;
                this.contractExpander1.RedirectUrl = redirectUrl;

                NFMT.Common.SelectModel select = payApplyBLL.GetPayApplyStocksSelect(1, 100, "spa.RefId desc", payApply.PayApplyId);
                result = payApplyBLL.Load(user, select,new NFMT.Common.BasicAuth());
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                if (dt == null)
                    Response.Redirect(redirectUrl);

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

                result = payApplyBLL.GetContractBalancePayment(user, sub.SubId, 0);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                BalancePaymentValue = (decimal)result.ReturnValue;
            }
        }
示例#22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "StockReceiptList.aspx";

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

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

                //获取仓库回执
                int receiptId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out receiptId))
                    Response.Redirect(redirectUrl);

                NFMT.WareHouse.BLL.StockReceiptBLL receiptBLL = new NFMT.WareHouse.BLL.StockReceiptBLL();
                result = receiptBLL.Get(user, receiptId);

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

                NFMT.WareHouse.Model.StockReceipt stockReceipt = result.ReturnValue as NFMT.WareHouse.Model.StockReceipt;
                if (stockReceipt == null || stockReceipt.ReceiptId <= 0)
                    Response.Redirect(redirectUrl);

                this.curStockReceipt = stockReceipt;

                //获取合约与子合约
                NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBLL.Get(user, stockReceipt.ContractSubId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

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

                this.curContractSub = sub;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                //主合约
                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                this.contractExpander1.CurContract = contract;
                this.contractExpander1.CurContractSub = sub;
                this.contractExpander1.RedirectUrl = redirectUrl;

                this.navigation1.Routes.Add("回执列表", redirectUrl);
                this.navigation1.Routes.Add("回执明细", string.Empty);

                string sids = "0";
                //获取回执明细
                NFMT.WareHouse.BLL.StockReceiptDetailBLL detailBLL = new NFMT.WareHouse.BLL.StockReceiptDetailBLL();
                result = detailBLL.Load(user, stockReceipt.ReceiptId,NFMT.Common.StatusEnum.已作废);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                List<NFMT.WareHouse.Model.StockReceiptDetail> details = result.ReturnValue as List<NFMT.WareHouse.Model.StockReceiptDetail>;
                if (details == null)
                    Response.Redirect(redirectUrl);

                if (details.Count > 0)
                    sids = string.Empty;
                for (int i = 0; i < details.Count; i++)
                {
                    NFMT.WareHouse.Model.StockReceiptDetail detail = details[i];
                    sids += detail.StockLogId.ToString();
                    if (i < details.Count - 1)
                        sids += ",";
                }

                NFMT.Common.SelectModel select = receiptBLL.GetReceiptingStockListSelect(1, 100, "sto.StockId desc", sub.SubId, receiptId, sids);
                result = receiptBLL.Load(user, select);
                int totalRows = result.AffectCount;
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.curReceiptingJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

                System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
                string json = serializer.Serialize(stockReceipt);
                this.hidModel.Value = json;
            }
        }
示例#23
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());
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 123, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 });

                string redirectUrl = "PayContractAllotToStockList.aspx";
                this.navigation1.Routes.Add("合约付款分配至库存列表", redirectUrl);
                this.navigation1.Routes.Add("合约付款分配至库存修改", string.Empty);
                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();
                NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

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

                //获取合约付款分配至库存
                NFMT.Funds.BLL.PaymentStockDetailBLL paymentStockDetailBLL = new NFMT.Funds.BLL.PaymentStockDetailBLL();
                result = paymentStockDetailBLL.Get(user, detailId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

                paymentStockDetail = result.ReturnValue as NFMT.Funds.Model.PaymentStockDetail;
                if (paymentStockDetail == null)
                    this.Page.WarmAlert("获取合约付款分配至库存失败", redirectUrl);

                //获取库存
                NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL();
                result = stockBLL.Get(user, paymentStockDetail.StockId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

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

                //获取业务单号
                NFMT.WareHouse.BLL.StockNameBLL stockNameBLL = new NFMT.WareHouse.BLL.StockNameBLL();
                result = stockNameBLL.Get(user, stock.StockNameId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

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

                //获取付款
                int paymentId = paymentStockDetail.PaymentId;
                NFMT.Funds.BLL.PaymentBLL paymentBLL = new NFMT.Funds.BLL.PaymentBLL();
                result = paymentBLL.Get(user, paymentId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

                curPayment = result.ReturnValue as NFMT.Funds.Model.Payment;
                if (curPayment == null)
                    this.Page.WarmAlert("获取付款失败", redirectUrl);

                //获取虚拟付款
                if (curPayment.VirtualBala > 0)
                {
                    NFMT.Funds.BLL.PaymentVirtualBLL paymentVirtualBLL = new NFMT.Funds.BLL.PaymentVirtualBLL();
                    result = paymentVirtualBLL.GetByPaymentId(user, curPayment.PaymentId);
                    if (result.ResultStatus != 0)
                        Response.Redirect(redirectUrl);
                    NFMT.Funds.Model.PaymentVirtual paymentVirtual = result.ReturnValue as NFMT.Funds.Model.PaymentVirtual;
                    if (paymentVirtual == null)
                        Response.Redirect(redirectUrl);

                    this.curPaymentVirtual = paymentVirtual;
                }

                //获取付款申请
                NFMT.Funds.BLL.PayApplyBLL payApplyBLL = new NFMT.Funds.BLL.PayApplyBLL();
                result = payApplyBLL.Get(user, curPayment.PayApplyId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

                curPayApply = result.ReturnValue as NFMT.Funds.Model.PayApply;
                if (curPayApply == null)
                    this.Page.WarmAlert("获取付款申请失败", redirectUrl);

                //获取合约款
                NFMT.Funds.BLL.PaymentContractDetailBLL paymentContractDetailBLL = new NFMT.Funds.BLL.PaymentContractDetailBLL();
                result = paymentContractDetailBLL.GetByPaymentId(user, paymentId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

                paymentContractDetail = result.ReturnValue as NFMT.Funds.Model.PaymentContractDetail;
                if (paymentContractDetail == null)
                    this.Page.WarmAlert("获取合约款失败", redirectUrl);

                //获取子合约
                NFMT.Contract.BLL.ContractSubBLL contractSubBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = contractSubBLL.Get(user, paymentContractDetail.ContractSubId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

                curSub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (curSub == null)
                    this.Page.WarmAlert("获取子合约失败", redirectUrl);

                //合约
                NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL();
                result = bll.Get(user, curSub.ContractId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId == 0)
                    this.Page.WarmAlert("获取合约失败", redirectUrl);

                //获取可分配款
                result = paymentStockDetailBLL.LoadByPaymentId(user, paymentId);
                if (result.ResultStatus != 0)
                    this.Page.WarmAlert(result.Message, redirectUrl);

                List<NFMT.Funds.Model.PaymentStockDetail> paymentStockDetails = result.ReturnValue as List<NFMT.Funds.Model.PaymentStockDetail>;
                if (paymentStockDetails == null || !paymentStockDetails.Any())
                    this.Page.WarmAlert("获取库存财务付款明细失败", redirectUrl);

                canAllotBala = curPayment.PayBala - paymentStockDetails.Sum(a => a.PayBala) + paymentStockDetail.PayBala;

                this.contractExpander1.CurContract = contract;
                this.contractExpander1.CurContractSub = curSub;
                this.contractExpander1.RedirectUrl = redirectUrl;

                this.PayMatterStyle = (int)NFMT.Data.StyleEnum.付款事项;
                this.PayModeStyle = (int)NFMT.Data.StyleEnum.PayMode;
            }
        }
示例#25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = string.Format("{0}DoPrice/PricingList.aspx", NFMT.Common.DefaultValue.NftmSiteName);

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

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

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

                NFMT.DoPrice.BLL.PricingBLL pricingBLL = new NFMT.DoPrice.BLL.PricingBLL();
                //获取点价实体
                result = pricingBLL.Get(user, pricingId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                pricing = result.ReturnValue as NFMT.DoPrice.Model.Pricing;
                if (pricing == null)
                    Response.Redirect(redirectUrl);

                int pricingApplyId = pricing.PricingApplyId;

                NFMT.DoPrice.BLL.PricingApplyBLL pricingApplyBLL = new NFMT.DoPrice.BLL.PricingApplyBLL();
                //获取点价申请
                result = pricingApplyBLL.Get(user, pricingApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                pricingApply = result.ReturnValue as NFMT.DoPrice.Model.PricingApply;
                if (pricingApply == null || pricingApply.PricingApplyId <= 0)
                    Response.Redirect(redirectUrl);

                int subId = pricingApply.SubContractId;

                //获取申请
                NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL();
                result = applyBLL.Get(user, pricingApply.ApplyId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                apply = result.ReturnValue as NFMT.Operate.Model.Apply;
                if (apply == null || apply.ApplyId <= 0)
                    Response.Redirect(redirectUrl);

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

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

                this.curContractSub = sub;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                currencyId = curContract.SettleCurrency;
                assetId = curContract.AssetId;
                mUId = curContract.UnitId;
                NFMT.Data.Model.MeasureUnit mu = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == curContract.UnitId);
                if (mu != null && mu.MUId > 0)
                    this.curMUName = mu.MUName;

                if (currencyId != 0)
                {
                    NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(a => a.CurrencyId == currencyId);
                    if (currency != null)
                        currencyName = currency.CurrencyName;
                }

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == contract.UnitId);
                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

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

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curContractSub;
                this.contractExpander1.RedirectUrl = redirectUrl;
            }
        }
示例#26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser;

            if (!IsPostBack)
            {
                string redirectUrl = "OrderList.aspx";

                this.navigation1.Routes.Add("制单指令列表", redirectUrl);
                this.navigation1.Routes.Add("制单指令明细", string.Empty);

                NFMT.Common.ResultModel result = new NFMT.Common.ResultModel();

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

                //获取制单指令
                NFMT.Document.BLL.DocumentOrderBLL orderBLL = new NFMT.Document.BLL.DocumentOrderBLL();
                result = orderBLL.Get(user, orderId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Document.Model.DocumentOrder order = result.ReturnValue as NFMT.Document.Model.DocumentOrder;
                if (order == null || order.OrderId <= 0)
                    Response.Redirect(redirectUrl);

                this.curOrder = order;

                NFMT.Document.BLL.DocumentOrderDetailBLL detailBLL = new NFMT.Document.BLL.DocumentOrderDetailBLL();
                result = detailBLL.GetByOrderId(user, order.OrderId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Document.Model.DocumentOrderDetail orderDetail = result.ReturnValue as NFMT.Document.Model.DocumentOrderDetail;
                if (orderDetail == null || orderDetail.DetailId <= 0)
                    Response.Redirect(redirectUrl);

                this.curOrderDetail = orderDetail;

                #region 合约信息

                //合约信息
                NFMT.Contract.BLL.ContractSubBLL subBll = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBll.Get(user, order.SubId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);
                NFMT.Contract.Model.ContractSub sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.ContractId == 0)
                    Response.Redirect(redirectUrl);
                this.curSub = sub;

                NFMT.Contract.BLL.ContractBLL bll = new NFMT.Contract.BLL.ContractBLL();
                result = bll.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                NFMT.Contract.Model.Contract con = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (con == null || con.ContractId == 0)
                    Response.Redirect(redirectUrl);
                this.curContract = con;

                NFMT.Data.Model.MeasureUnit muContract = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == con.UnitId);
                NFMT.Data.Model.Currency cur = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                this.curCurrency = cur;

                NFMT.Data.Model.MeasureUnit muSub = NFMT.Data.BasicDataProvider.MeasureUnits.Single(temp => temp.MUId == sub.UnitId);

                this.contractExpander1.CurContract = this.curContract;
                this.contractExpander1.CurContractSub = this.curSub;
                this.contractExpander1.RedirectUrl = redirectUrl;

                #endregion

                NFMT.Common.SelectModel select = orderBLL.GetOrderSelectedSelect(1, 100, "dos.DetailId desc", order.OrderId);
                result = orderBLL.Load(user, select);
                int totalRows = result.AffectCount;
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.JsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

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

                //attach
                this.attach1.BusinessIdValue = this.curOrder.OrderId;
            }
        }
示例#27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string redirectUrl = "StockReceiptList.aspx";

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

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

                //获取合约与子合约
                int subId = 0;
                if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out subId))
                    Response.Redirect(redirectUrl);

                NFMT.Contract.BLL.ContractSubBLL subBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = subBLL.Get(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

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

                this.curContractSub = sub;

                //合约币种
                NFMT.Data.Model.Currency currency = NFMT.Data.BasicDataProvider.Currencies.FirstOrDefault(temp => temp.CurrencyId == sub.SettleCurrency);
                if (currency != null && currency.CurrencyId > 0)
                    this.currencyName = currency.CurrencyName;
                //合约计量单位
                NFMT.Data.Model.MeasureUnit mu = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == sub.UnitId);
                if (mu != null && mu.MUId > 0)
                    this.MUName = mu.MUName;

                NFMT.Contract.BLL.ContractBLL conBLL = new NFMT.Contract.BLL.ContractBLL();
                result = conBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                //主合约
                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                this.curContract = contract;

                this.contractExpander1.CurContract = contract;
                this.contractExpander1.CurContractSub = sub;
                this.contractExpander1.RedirectUrl = redirectUrl;

                this.navigation1.Routes.Add("回执列表", redirectUrl);
                this.navigation1.Routes.Add("合约列表", "StockReceiptContractList.aspx");
                this.navigation1.Routes.Add("回执新增", string.Empty);

                tradeDirString = ((NFMT.Contract.TradeDirectionEnum)contract.TradeDirection).ToString();

                //ReceiptingStockList Json
                NFMT.WareHouse.BLL.StockReceiptBLL bll = new NFMT.WareHouse.BLL.StockReceiptBLL();

                int receiptId = 0;
                string sids = "0";
                NFMT.Common.SelectModel select = bll.GetReceiptingStockListSelect(1, 100, "sto.StockId desc", sub.SubId, receiptId, sids);
                result = bll.Load(user, select);
                int totalRows = result.AffectCount;
                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                this.curReceiptingJson = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter());

            }
        }
示例#28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 120, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 });

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

                string redirectUrl = "InterestContractList.aspx";
                this.navigation1.Routes.Add("利息结算列表", "InterestList.aspx");
                this.navigation1.Routes.Add("质押合约列表", redirectUrl);
                this.navigation1.Routes.Add("利息结算新增", string.Empty);

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

                //获取子合约
                NFMT.Contract.BLL.ContractSubBLL contractSubBLL = new NFMT.Contract.BLL.ContractSubBLL();
                result = contractSubBLL.Get(user, subId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                sub = result.ReturnValue as NFMT.Contract.Model.ContractSub;
                if (sub == null || sub.SubId <= 0)
                    Utility.JsUtility.WarmAlert(this.Page, "获取子合约失败", redirectUrl);

                NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
                result = contractBLL.Get(user, sub.ContractId);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                //获取合约
                contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取合约失败", redirectUrl);

                this.txbContractNo.Value = contract.OutContractNo;

                if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.采购)
                    strTradeDirection = "采购";
                else if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.销售)
                    strTradeDirection = "销售";
                else
                    strTradeDirection = string.Empty;

                this.txbTradeDirection.Value = strTradeDirection;

                NFMT.Data.Model.Asset asset = NFMT.Data.BasicDataProvider.Assets.SingleOrDefault(a => a.AssetId == contract.AssetId);
                this.txbAssetName.Value = asset.AssetName;

                //获取子合约中的币种
                cur = NFMT.Data.BasicDataProvider.Currencies.SingleOrDefault(a => a.CurrencyId == sub.SettleCurrency);
                if (cur == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取币种失败", redirectUrl);

                //获取合约单位
                mu = NFMT.Data.BasicDataProvider.MeasureUnits.SingleOrDefault(a => a.MUId == sub.UnitId);
                if (mu == null)
                    Utility.JsUtility.WarmAlert(this.Page, "获取单位失败", redirectUrl);

                //获取合约抬头
                //我方
                NFMT.Contract.BLL.SubCorporationDetailBLL subCorporationDetailBLL = new NFMT.Contract.BLL.SubCorporationDetailBLL();
                result = subCorporationDetailBLL.Load(user, subId, true);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                subInCorpDetails = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
                if (subInCorpDetails == null || !subInCorpDetails.Any())
                    Utility.JsUtility.WarmAlert(this.Page, "获取我方抬头失败", redirectUrl);

                this.txbInCorpId.Value = subInCorpDetails.FirstOrDefault(a => a.IsDefaultCorp == true).CorpName;

                //对方
                result = subCorporationDetailBLL.Load(user, subId, false);
                if (result.ResultStatus != 0)
                    Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl);

                subOutCorpDetails = result.ReturnValue as List<NFMT.Contract.Model.SubCorporationDetail>;
                if (subInCorpDetails == null || !subInCorpDetails.Any())
                    Utility.JsUtility.WarmAlert(this.Page, "获取我方抬头失败", redirectUrl);

                this.txbOutCorpId.Value = subOutCorpDetails.FirstOrDefault(a => a.IsDefaultCorp == true).CorpName;

                //获取剩余本金
                NFMT.DoPrice.BLL.InterestBLL interestBLL = new NFMT.DoPrice.BLL.InterestBLL();
                result = interestBLL.GetLastCapitalBySubId(user, subId);
                if (result.ResultStatus == 0 && result.ReturnValue != null)
                {
                    decimal.TryParse(result.ReturnValue.ToString(), out this.lastPayCapital);
                }

                //获取剩余净重
                result = interestBLL.GetLastNetWeightBySubId(user, subId);
                if (result.ResultStatus == 0 && result.ReturnValue != null)
                {
                    decimal.TryParse(result.ReturnValue.ToString(), out this.netWeight);
                }

                this.SelectJson(sub.SubId);
            }
        }
示例#29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility.VerificationUtility ver = new Utility.VerificationUtility();
                ver.JudgeOperate(this.Page, 94, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 });

                string redirectUrl = "CashInAllotList.aspx";
                this.navigation1.Routes.Add("收款分配列表", redirectUrl);
                this.navigation1.Routes.Add("合约收款分配新增", string.Empty);

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

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

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

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

                this.curSub = sub;

                //获取合约
                NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL();
                result = contractBLL.Get(user, sub.ContractId);

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

                NFMT.Contract.Model.Contract contract = result.ReturnValue as NFMT.Contract.Model.Contract;
                if (contract == null || contract.ContractId <= 0)
                    Response.Redirect(redirectUrl);

                result = subBLL.GetContractOutCorp(user, subId);
                if (result.ResultStatus != 0)
                    Response.Redirect(redirectUrl);

                this.contractExpander1.CurContract = contract;
                this.contractExpander1.CurContractSub = sub;
                this.contractExpander1.RedirectUrl = redirectUrl;

                System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable;
                if (dt == null || dt.Rows.Count == 0)
                    Response.Redirect(redirectUrl);

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    System.Data.DataRow dr = dt.Rows[i];

                    if (dr["CorpId"] != DBNull.Value)
                    {
                        if (i != 0)
                            this.curOutCorpIds += ",";

                        this.curOutCorpIds += dr["CorpId"].ToString();
                    }
                }
                this.JsonOutCorp = Newtonsoft.Json.JsonConvert.SerializeObject(result.ReturnValue);

                //拼接合约库存
                NFMT.WareHouse.BLL.StockLogBLL stockLogBLL = new NFMT.WareHouse.BLL.StockLogBLL();
                NFMT.Common.SelectModel select = stockLogBLL.GetLogListBySubSelect(1, 100, "sl.StockLogId desc", sub.SubId);
                result = stockLogBLL.Load(user, select);

                dt = result.ReturnValue as System.Data.DataTable;
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("[");
                if (dt != null && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        System.Data.DataRow dr = dt.Rows[i];

                        if (i != 0)
                            sb.Append(",");

                        string refNo = dr["RefNo"].ToString();
                        int stockLogId = 0;
                        decimal stockLogGrossWeight = 0;
                        decimal stockLogNetWeight = 0;
                        int.TryParse(dr["StockLogId"].ToString(), out stockLogId);
                        decimal.TryParse(dr["GrossAmount"].ToString(), out stockLogGrossWeight);
                        decimal.TryParse(dr["NetAmount"].ToString(),out stockLogNetWeight);
                        string muName = dr["MUName"].ToString();
                        string assetName = dr["AssetName"].ToString();
                        string brandName = dr["BrandName"].ToString();

                        sb.Append("{ Html: \"<div style='padding: 1px;'>");
                        sb.AppendFormat("<div>{0}</div>", refNo);
                        sb.AppendFormat("<div>毛重: {0}{1}</div>", stockLogGrossWeight, muName);
                        sb.AppendFormat("<div>净重: {0}{1}</div>", stockLogNetWeight, muName);
                        sb.AppendFormat("<div>品种: {0}</div><div>品牌: {1}</div></div>\"", assetName, brandName);
                        sb.AppendFormat(", Title: \"{0}\"",refNo);
                        sb.Append(",StockLogId:");
                        sb.Append(stockLogId);
                        sb.Append("}");
                    }
                }
                sb.Append("]");

                this.JsonStock = sb.ToString();
            }
        }