protected void Page_Load(object sender, EventArgs e) { SiteUtility.VerificationUtility ver = new SiteUtility.VerificationUtility(); ver.JudgeOperate(this.Page, 61, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.查询 }); NFMT.Common.UserModel user = new SiteUtility.UserUtility().CurrentUser; this.CurrentUser = user; }
protected void Page_Load(object sender, EventArgs e) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; this.curUser = user; if (!IsPostBack) { string redirectUrl = "DocumentList.aspx"; this.navigation1.Routes.Add("制单列表", redirectUrl); this.navigation1.Routes.Add("可制单指令列表", "OrderReadyList.aspx"); 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(); NFMT.Common.ResultModel 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.Common.SelectModel select = orderBLL.GetOrderSelectedSelect(1, 100, "dos.DetailId desc", order.OrderId,true); 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()); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 44, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.查询 }); user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); string redirectUrl = string.Format("{0}WareHouse/StockOutList.aspx", NFMT.Common.DefaultValue.NftmSiteName); int stockOutId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out stockOutId) || stockOutId <= 0) this.Page.WarmAlert("参数错误", redirectUrl); //获取出库 NFMT.WareHouse.BLL.StockOutBLL stockOutBLL = new NFMT.WareHouse.BLL.StockOutBLL(); result = stockOutBLL.Get(user, stockOutId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); stockOut = result.ReturnValue as NFMT.WareHouse.Model.StockOut; if (stockOut == null) this.Page.WarmAlert("获取出库失败", redirectUrl); //获取出库申请 NFMT.WareHouse.BLL.StockOutApplyBLL stockOutApplyBLL = new NFMT.WareHouse.BLL.StockOutApplyBLL(); result = stockOutApplyBLL.Get(user, stockOut.StockOutApplyId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); stockOutApply = result.ReturnValue as NFMT.WareHouse.Model.StockOutApply; if (stockOutApply == null) this.Page.WarmAlert("获取出库申请失败", redirectUrl); //获取出库明细 NFMT.WareHouse.BLL.StockOutDetailBLL stockOutDetailBLL = new NFMT.WareHouse.BLL.StockOutDetailBLL(); result = stockOutDetailBLL.Load(user, stockOutId); if (result.ResultStatus != 0) this.Page.WarmAlert(result.Message, redirectUrl); details = result.ReturnValue as List<NFMT.WareHouse.Model.StockOutDetail>; if (details == null || !details.Any()) this.Page.WarmAlert("获取出库明细失败", redirectUrl); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 81, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 }); this.navigation1.Routes.Add("联系人共享", string.Format("{0}User/ContactShare.aspx", NFMT.Common.DefaultValue.NftmSiteName)); this.navigation1.Routes.Add("联系人共享明细", string.Empty); user = Utility.UserUtility.CurrentUser; if (user == null) Response.Redirect(string.Format("{0}Login.aspx", NFMT.Common.DefaultValue.NftmSiteName)); empId = user.EmpId; } }
protected void Page_Load(object sender, EventArgs e) { user = new NFMT.Common.UserModel() { AccountId = 1, AccountName = "abc", //BlocId = 1, //CorpIds = new List<int> { 1 }, //DeptIds = new List<int> { 1 }, EmpId = 1, EmpName = "张三" }; Session["UserModel"] = user; NodeID = Request.QueryString["NodeID"].ToString(); if (!IsPostBack) { DataBingding(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 102, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.录入 }); string redirectUrl = string.Format("{0}User/AuthOperateAllot.aspx", NFMT.Common.DefaultValue.NftmSiteName); NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); user = Utility.UserUtility.CurrentUser; this.navigation1.Routes.Add("菜单操作权限分配-员工列表", redirectUrl); this.navigation1.Routes.Add("员工菜单操作权限分配", string.Empty); if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out empId) || empId <= 0) Response.Redirect(redirectUrl, false); NFMT.User.BLL.EmployeeBLL employeeBLL = new NFMT.User.BLL.EmployeeBLL(); result = employeeBLL.Get(user, empId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl, false); NFMT.User.Model.Employee employee = result.ReturnValue as NFMT.User.Model.Employee; if (employee == null) Response.Redirect(redirectUrl, false); NFMT.User.Model.Department dept = NFMT.User.UserProvider.Departments.FirstOrDefault(temp => temp.DeptId == employee.DeptId); if (dept != null && dept.DeptId > 0) this.ddlDeptId.InnerText = dept.DeptName; this.txbEmpCode.InnerText = employee.EmpCode; this.txbEmpName.InnerText = employee.Name; this.rdMale.InnerText = employee.Sex ? "男" : "女"; this.dtBirthday.InnerText = employee.BirthDay.ToShortDateString(); this.txbTel.InnerText = employee.Telephone; this.txbPhone.InnerText = employee.Phone; NFMT.User.WorkStatusEnum workStatus = (NFMT.User.WorkStatusEnum)employee.WorkStatus; this.ddlWorkStatus.InnerText = workStatus.ToString(); } }
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; this.hidTradeDirection.Value = ((int)NFMT.Data.StyleEnum.TradeDirection).ToString(); this.hidTradeBorder.Value = ((int)NFMT.Data.StyleEnum.TradeBorder).ToString(); this.hidContractLimit.Value = ((int)NFMT.Data.StyleEnum.ContractLimit).ToString(); //this.hidPriceMode.Value = ((int)NFMT.Data.StyleEnum.PriceMode).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(); this.navigation1.Routes.Add("合约列表","ContractList.aspx"); this.navigation1.Routes.Add("合约添加",string.Empty); }
protected void Page_Load(object sender, EventArgs e) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; this.curUser = user; if (!IsPostBack) { string redirectUrl = "OrderReplaceList.aspx"; this.navigation1.Routes.Add("替临制单列表", redirectUrl); this.navigation1.Routes.Add("替临制单指令修改", string.Empty); this.ReplaceOrderType = (int)NFMT.Document.OrderTypeEnum.替临制单指令; 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(); NFMT.Common.ResultModel 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.curReplaceOrder = 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; //获取临票指令 result = orderBLL.Get(user, order.CommercialId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Document.Model.DocumentOrder comOrder = result.ReturnValue as NFMT.Document.Model.DocumentOrder; if (comOrder == null || comOrder.OrderId <= 0) Response.Redirect(redirectUrl); this.curCommercialOrder = comOrder; //替临指令库存 NFMT.Common.SelectModel select = orderBLL.GetReplaceStocksSelect(1, 100, "dos.DetailId desc", order.CommercialId, false); result = orderBLL.Load(user, select); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.JsonReplaceStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); //临票指令库存 select = orderBLL.GetReplaceStocksSelect(1, 100, "dos.DetailId desc", order.CommercialId, true); result = orderBLL.Load(user, select); dt = result.ReturnValue as System.Data.DataTable; this.JsonCommercialStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); //attach this.attach1.BusinessIdValue = this.curReplaceOrder.OrderId; } }
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 = "SubStockInList.aspx"; this.hidTradeDirection.Value = ((int)NFMT.Data.StyleEnum.TradeDirection).ToString(); this.hidTradeBorder.Value = ((int)NFMT.Data.StyleEnum.TradeBorder).ToString(); this.hidContractLimit.Value = ((int)NFMT.Data.StyleEnum.ContractLimit).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(); this.navigation1.Routes.Add("合约列表", "ContractList.aspx"); this.navigation1.Routes.Add("库存列表", redirectUrl); this.navigation1.Routes.Add("合约添加", string.Empty); stockLogIds = Request.QueryString["lgs"]; //库存验证 if (string.IsNullOrEmpty(stockLogIds)) Utility.JsUtility.WarmAlert(this, "未选中任务库存", redirectUrl); string[] ids = stockLogIds.Split(new char[]{','},StringSplitOptions.RemoveEmptyEntries); if (ids== null || ids.Length == 0) Utility.JsUtility.WarmAlert(this, "未选中任务库存", redirectUrl); int assetId = 0; int logDirection = (int)NFMT.WareHouse.LogDirectionEnum.In;//入库流水 int customsType = 0; NFMT.WareHouse.BLL.StockLogBLL stockLogBLL = new NFMT.WareHouse.BLL.StockLogBLL(); NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); foreach (string id in ids) { int stockLogId = 0; if (!int.TryParse(id, out stockLogId) || stockLogId <= 0) Utility.JsUtility.WarmAlert(this, "库存序号错误", redirectUrl); result = stockLogBLL.Get(user, stockLogId); if (result.ResultStatus != 0) Utility.JsUtility.WarmAlert(this, result.Message, redirectUrl); NFMT.WareHouse.Model.StockLog stockLog = result.ReturnValue as NFMT.WareHouse.Model.StockLog; if (stockLog == null || stockLog.StockLogId <= 0) Utility.JsUtility.WarmAlert(this, "库存流水不存在", redirectUrl); if (assetId == 0) { assetId = stockLog.AssetId; this.curAssetId = assetId; } if (customsType == 0) { customsType = stockLog.CustomsType; if (customsType == (int)NFMT.WareHouse.CustomTypeEnum.关内) curTradeBorder = (int)NFMT.Contract.TradeBorderEnum.内贸; else curTradeBorder = (int)NFMT.Contract.TradeBorderEnum.外贸; } //比较是否同一品种 if (assetId != stockLog.AssetId) Utility.JsUtility.WarmAlert(this, "选中库存非同一品种", redirectUrl); //比较是否为入库流水 if (stockLog.LogDirection != logDirection) Utility.JsUtility.WarmAlert(this, "选中库存流水非入库流水,", redirectUrl); //比对关内外库存 if (stockLog.CustomsType != customsType) Utility.JsUtility.WarmAlert(this,"选中库存关境状态不相同",redirectUrl); sumGrossAmount += stockLog.GrossAmount; } NFMT.Data.Model.Asset asset = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == assetId); this.curAsset = asset; }
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; } }
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) { 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; } }
protected void Page_Load(object sender, EventArgs e) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; this.curUser = user; if (!IsPostBack) { string redirectUrl = "DocumentList.aspx"; this.navigation1.Routes.Add("制单列表", redirectUrl); this.navigation1.Routes.Add("可制单指令列表", "OrderReadyList.aspx"); 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(); NFMT.Common.ResultModel 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.Data.Model.Asset ass = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == order.AssetId); NFMT.Data.Model.MeasureUnit mu = NFMT.Data.BasicDataProvider.MeasureUnits.FirstOrDefault(temp => temp.MUId == order.UnitId); //指令库存 NFMT.Common.SelectModel select = orderBLL.GetOrderSelectedSelect(1, 100, "dos.DetailId desc", order.OrderId, true); 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(mu != null) dr["MUName"] = mu.MUName; } } this.JsonStr = 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, 37, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.执行完成, NFMT.Common.OperateEnum.执行完成撤销 }); int contractId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"])) Response.Redirect("ContractList.aspx"); if (!int.TryParse(Request.QueryString["id"], out contractId)) Response.Redirect("ContractList.aspx"); this.navigation1.Routes.Add("合约列表", "ContractList.aspx"); 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.hidContractLimit.Value = ((int)NFMT.Data.StyleEnum.ContractLimit).ToString(); //this.hidPriceMode.Value = ((int)NFMT.Data.StyleEnum.PriceMode).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(); user = Utility.UserUtility.CurrentUser; contractBLL = new NFMT.Contract.BLL.ContractBLL(); 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(); //获取合约 NFMT.Common.ResultModel result = contractBLL.Get(user, contractId); if (result.ResultStatus != 0) Response.Redirect("ContractList.aspx"); curContract = result.ReturnValue as NFMT.Contract.Model.Contract; if (curContract == null) Response.Redirect("ContractList.aspx"); //获取明细 result = detailBLL.GetDetailByContractId(user, contractId); if (result.ResultStatus != 0) Response.Redirect("ContractList.aspx"); curContraceDetail = result.ReturnValue as NFMT.Contract.Model.ContractDetail; if (curContraceDetail == null) Response.Redirect("ContractList.aspx"); //获取价格 result = priceBLL.GetPriceByContractId(user, contractId); if (result.ResultStatus != 0) Response.Redirect("ContractList.aspx"); curContractPrice = result.ReturnValue as NFMT.Contract.Model.ContractPrice; if (curContractPrice == null) Response.Redirect("ContractList.aspx"); //获取公司列表 //我方公司 result = corpBLL.LoadCorpListByContractId(user, contractId, true); if (result.ResultStatus != 0) Response.Redirect("ContractList.aspx"); curInCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>; if (curInCorps == null || curInCorps.Count == 0) Response.Redirect("ContractList.aspx"); //对方公司 result = corpBLL.LoadCorpListByContractId(user, contractId, false); if (result.ResultStatus != 0) Response.Redirect("ContractList.aspx"); curOutCorps = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>; if (curOutCorps == null || curOutCorps.Count == 0) Response.Redirect("ContractList.aspx"); //执行部门 result = deptBLL.LoadDeptByContractId(user, contractId); if (result.ResultStatus != 0) Response.Redirect("ContractList.aspx"); 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(); } 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) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; this.curUser = user; if (!IsPostBack) { string redirectUrl = "DocumentList.aspx"; this.navigation1.Routes.Add("制单列表", redirectUrl); this.navigation1.Routes.Add("制单明细", string.Empty); int docId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out docId) || docId <= 0) Response.Redirect(redirectUrl); //获取制单 NFMT.Document.BLL.DocumentBLL docBLL = new NFMT.Document.BLL.DocumentBLL(); NFMT.Common.ResultModel result = docBLL.Get(user, docId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.Document.Model.Document documnet = result.ReturnValue as NFMT.Document.Model.Document; if (documnet == null || documnet.DocumentId <= 0) Response.Redirect(redirectUrl); this.curDocument = documnet; //获取指令 NFMT.Document.BLL.DocumentOrderBLL orderBLL = new NFMT.Document.BLL.DocumentOrderBLL(); result = orderBLL.Get(user, documnet.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.Common.SelectModel select = orderBLL.GetOrderSelectedSelect(1, 100, "dos.DetailId desc", order.OrderId, true); //result = orderBLL.Load(user, select); //int totalRows = result.AffectCount; //System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; //this.OrderJsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); NFMT.Common.SelectModel select = docBLL.GetDocumnetStocksSelect(1, 100, "ds.DetailId desc", documnet.DocumentId); result = orderBLL.Load(user, select); System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; this.DocumentJsonStr = 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(documnet); this.hidModel.Value = json; //attach this.attach1.BusinessIdValue = this.curOrder.OrderId; } }
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; } }
protected void Page_Load(object sender, EventArgs e) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; this.curUser = user; if (!IsPostBack) { string redirectUrl = "OrderReplaceList.aspx"; this.navigation1.Routes.Add("替临制单列表", redirectUrl); this.navigation1.Routes.Add("已承兑临票制单指令列表", "OrderCommercialList.aspx"); this.navigation1.Routes.Add("替临制单指令新增", string.Empty); this.ReplaceOrderType = (int)NFMT.Document.OrderTypeEnum.替临制单指令; 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(); NFMT.Common.ResultModel 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.Common.SelectModel select = orderBLL.GetComOrderStocksSelect(1, 100, "dos.DetailId desc", order.OrderId, true); 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 (dr["InvoiceNo"] != null && dr["InvoiceNo"] != DBNull.Value) { string invoiceNo = dr["InvoiceNo"].ToString(); invoiceNo = string.Format("{0}{1}",invoiceNo.Substring(0, invoiceNo.Length - 1),"P"); } } } this.JsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt, new Newtonsoft.Json.Converters.DataTableConverter()); } }
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); stockIds = Request.QueryString["ids"]; //库存验证 if (string.IsNullOrEmpty(stockIds)) Utility.JsUtility.WarmAlert(this, "未选中任务库存", redirectUrl); string[] ids = stockIds.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (ids == null || ids.Length == 0) Utility.JsUtility.WarmAlert(this, "未选中任务库存", redirectUrl); int assetId = 0; int customsType = 0; NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL(); NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); NFMT.WareHouse.BLL.StockExclusiveBLL stockExclusiveBLL = new NFMT.WareHouse.BLL.StockExclusiveBLL(); foreach (string id in ids) { int stockId = 0; if (!int.TryParse(id, out stockId) || stockId <= 0) Utility.JsUtility.WarmAlert(this, "库存序号错误", redirectUrl); result = stockBLL.Get(user, stockId); if (result.ResultStatus != 0) Utility.JsUtility.WarmAlert(this, result.Message, redirectUrl); NFMT.WareHouse.Model.Stock stock = result.ReturnValue as NFMT.WareHouse.Model.Stock; if (stock == null || stock.StockId <= 0) Utility.JsUtility.WarmAlert(this, "库存不存在", redirectUrl); if (assetId == 0) assetId = stock.AssetId; if (customsType == 0) { customsType = stock.CustomsType; if (customsType == (int)NFMT.WareHouse.CustomTypeEnum.关内) curTradeBorder = (int)NFMT.Contract.TradeBorderEnum.内贸; else curTradeBorder = (int)NFMT.Contract.TradeBorderEnum.外贸; } //比较是否同一品种 if (assetId != stock.AssetId) Utility.JsUtility.WarmAlert(this, "选中库存非同一品种", redirectUrl); //比对关内外库存 if (stock.CustomsType != customsType) Utility.JsUtility.WarmAlert(this, "选中库存关境状态不相同", redirectUrl); result = stockExclusiveBLL.LoadByStockId(user, stock.StockId); if(result.ResultStatus!=0) Utility.JsUtility.WarmAlert(this, result.Message, redirectUrl); List<NFMT.WareHouse.Model.StockExclusive> excs = result.ReturnValue as List<NFMT.WareHouse.Model.StockExclusive>; if (excs == null) Utility.JsUtility.WarmAlert(this,"排他表获取失败", redirectUrl); decimal excAmount = excs.Sum(temp => temp.ExclusiveAmount); sumGrossAmount += (stock.CurNetAmount - excAmount); } NFMT.Data.Model.Asset asset = NFMT.Data.BasicDataProvider.Assets.FirstOrDefault(temp => temp.AssetId == assetId); this.curAsset = asset; // 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, string.Empty, NFMT.Common.DefaultValue.DefaultTime, NFMT.Common.DefaultValue.DefaultTime, stockIds); 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()); }
/// <summary> /// 绑定数据 /// </summary> private void DataBingding() { NFMT.Common.UserModel user = new NFMT.Common.UserModel() { AccountId = 1, AccountName = "abc", //BlocId = 1, //CorpIds = new List<int> { 1 }, //DeptIds = new List<int> { 1 }, EmpId = 1, EmpName = "张三" }; Session["UserModel"] = user; DataTable dt = (DataTable)bll.Load(user, new NFMT.Common.SelectModel() { ColumnName = "NodeId,NodeStatus,NodeLevel,MasterId,NodeName,NodeType,IsFirst,IsLast,PreNodeId,RoleId,AuthGroupId", TableName = "Node", WhereStr = "MasterId=" + MasterId, OrderStr = "NodeId", PageIndex = 1, PageSize = 10 }).ReturnValue; this.GridView1.DataSource = dt; this.GridView1.DataBind(); }