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; } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string assetName = context.Request.Form["assetName"]; string muId = context.Request.Form["muId"]; string hand = context.Request.Form["hands"]; string resultStr = "添加失败"; if (string.IsNullOrEmpty(assetName)) { resultStr = "品种名称不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (string.IsNullOrEmpty(muId)) { resultStr = "品种主要计量单位不能为空"; context.Response.Write(resultStr); context.Response.End(); } if (string.IsNullOrEmpty(hand)) { resultStr = "每手重量不能为空"; context.Response.Write(resultStr); context.Response.End(); } //录入品种种(add) NFMT.Data.BLL.AssetBLL bll = new NFMT.Data.BLL.AssetBLL(); NFMT.Data.Model.Asset asset = new NFMT.Data.Model.Asset(); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; asset.CreatorId = user.EmpId; asset.AssetName = assetName; asset.MUId = Convert.ToInt32(muId); asset.AssetStatus = NFMT.Common.StatusEnum.已录入; asset.AmountPerHand = Convert.ToInt32(hand); NFMT.Common.ResultModel result = bll.Insert(user, asset); resultStr = result.Message; context.Response.Write(resultStr); }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; context.Response.ContentType = "text/plain"; int id = 0; int operateId = 0; if (!int.TryParse(context.Request.Form["id"], out id) || id <= 0) { context.Response.Write("序号错误"); context.Response.End(); } if (!int.TryParse(context.Request.Form["oi"], out operateId) || operateId <= 0) { context.Response.Write("操作错误"); context.Response.End(); } NFMT.Data.BLL.AssetBLL cll = new NFMT.Data.BLL.AssetBLL(); NFMT.Data.Model.Asset crey = new NFMT.Data.Model.Asset() { AssetId = id, LastModifyId = user.EmpId }; NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); switch (operateEnum) { case NFMT.Common.OperateEnum.冻结: result = cll.Freeze(user, crey); break; case NFMT.Common.OperateEnum.解除冻结: result = cll.UnFreeze(user, crey); break; } context.Response.Write(result.Message); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 24, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); this.navigation1.Routes.Add("品种管理", string.Format("{0}BasicData/AssetList.aspx", NFMT.Common.DefaultValue.NftmSiteName)); this.navigation1.Routes.Add("品种修改", string.Empty); int id = 0; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { if (int.TryParse(Request.QueryString["id"], out id)) { if (id == 0) Response.Redirect("AssetList.aspx"); NFMT.Data.BLL.AssetBLL cyBLL = new NFMT.Data.BLL.AssetBLL(); var result = cyBLL.Get(Utility.UserUtility.CurrentUser, id); if (result.ResultStatus != 0) Response.Redirect("AssetList.aspx"); asset = result.ReturnValue as NFMT.Data.Model.Asset; if (asset != null) { this.txbAssetName.Value = asset.AssetName; this.HidNo.Value = asset.MUId.ToString(); this.hid.Value = Convert.ToString(asset.AssetId); this.txbAssetStatus.Value = ((int)asset.AssetStatus).ToString(); } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 24, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.冻结, NFMT.Common.OperateEnum.解除冻结 }); this.navigation1.Routes.Add("品种管理", string.Format("{0}BasicData/AssetList.aspx", NFMT.Common.DefaultValue.NftmSiteName)); this.navigation1.Routes.Add("品种明细", string.Empty); int id = 0; if (!string.IsNullOrEmpty(Request.QueryString["id"])) { if (int.TryParse(Request.QueryString["id"], out id)) { if (id == 0) Response.Redirect("AssetList.aspx"); NFMT.Data.BLL.AssetBLL currencyBLL = new NFMT.Data.BLL.AssetBLL(); var result = currencyBLL.Get(Utility.UserUtility.CurrentUser, id); if (result.ResultStatus != 0) Response.Redirect("AssetList.aspx"); assrt = result.ReturnValue as NFMT.Data.Model.Asset; if (assrt != null) { this.txbAssetName.InnerText = assrt.AssetName; NFMT.Data.Model.MeasureUnit mu = NFMT.Data.BasicDataProvider.MeasureUnits.SingleOrDefault(a => a.MUId == assrt.MUId); this.txbMUName.InnerText = mu.MUName; this.hidId.Value = Convert.ToString(assrt.AssetId); this.txbAssetStatus.InnerText =Convert.ToString(assrt.AssetStatus); } } } } }
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()); }
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) { 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(); } }
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) { 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) { if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 37, 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 = string.Format("{0}Contract/ContractList.aspx", NFMT.Common.DefaultValue.NftmSiteName); //this.navigation1.Routes.Add("合约列表", redirectUrl); //this.navigation1.Routes.Add("合约预览", string.Empty); int contractId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out contractId) || contractId <= 0) Utility.JsUtility.WarmAlert(this.Page, "参数错误", redirectUrl); //获取合约 NFMT.Contract.BLL.ContractBLL contractBLL = new NFMT.Contract.BLL.ContractBLL(); result = contractBLL.Get(user, 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); //获取品种 asset = NFMT.Data.BasicDataProvider.Assets.SingleOrDefault(a => a.AssetId == contract.AssetId); if (asset == null) Utility.JsUtility.WarmAlert(this.Page, "获取品种失败", redirectUrl); NFMT.Contract.BLL.ContractCorporationDetailBLL contractCorporationDetailBLL = new NFMT.Contract.BLL.ContractCorporationDetailBLL(); //采购销售 if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.采购) { tradeDirection = "采购"; isSelf = true; } else if (contract.TradeDirection == (int)NFMT.Contract.TradeDirectionEnum.销售) { tradeDirection = "销售"; isSelf = false; } //买方抬头 result = contractCorporationDetailBLL.LoadByContractId(user, contractId, isSelf); if (result.ResultStatus != 0) Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl); buyCorporationDetails = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>; if (buyCorporationDetails == null || !buyCorporationDetails.Any()) Utility.JsUtility.WarmAlert(this.Page, "获取买方抬头失败", redirectUrl); List<string> corpNames = new List<string>(); buyCorporationDetails.ForEach(detail => { corp = NFMT.User.UserProvider.Corporations.SingleOrDefault(a => a.CorpId == detail.CorpId); if (!corpNames.Contains(corp.CorpName)) corpNames.Add(corp.CorpName); }); buyCorpName = string.Join(",", corpNames); if (string.IsNullOrEmpty(buyCorpName)) Utility.JsUtility.WarmAlert(this.Page, "获取买方抬头失败", redirectUrl); //卖方抬头 result = contractCorporationDetailBLL.LoadByContractId(user, contractId, !isSelf); if (result.ResultStatus != 0) Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl); sellCorporationDetails = result.ReturnValue as List<NFMT.Contract.Model.ContractCorporationDetail>; if (sellCorporationDetails == null || !sellCorporationDetails.Any()) Utility.JsUtility.WarmAlert(this.Page, "获取卖方抬头失败", redirectUrl); corpNames.Clear(); sellCorporationDetails.ForEach(detail => { corp = NFMT.User.UserProvider.Corporations.SingleOrDefault(a => a.CorpId == detail.CorpId); if (!corpNames.Contains(corp.CorpName)) corpNames.Add(corp.CorpName); }); sellCorpName = string.Join(",", corpNames); if (string.IsNullOrEmpty(sellCorpName)) Utility.JsUtility.WarmAlert(this.Page, "获取卖方抬头失败", redirectUrl); //列表明细 result = contractBLL.GetContractDetail(user, contractId, (NFMT.Contract.TradeDirectionEnum)contract.TradeDirection); //if (result.ResultStatus != 0) // Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl); dt = result.ReturnValue as System.Data.DataTable; //if (dt == null || dt.Rows.Count < 1) // Utility.JsUtility.WarmAlert(this.Page, "获取合约明细失败", redirectUrl); contractDetailStr = GetGridDetail(dt, contract); //合约条款 NFMT.Contract.BLL.ContractClauseBLL contractClauseBLL = new NFMT.Contract.BLL.ContractClauseBLL(); result = contractClauseBLL.LoadClauseByContractId(user, contractId); if (result.ResultStatus != 0) Utility.JsUtility.WarmAlert(this.Page, result.Message, redirectUrl); List<NFMT.Data.Model.ContractClause> contractClauses = result.ReturnValue as List<NFMT.Data.Model.ContractClause>; if (contractClauses == null || !contractClauses.Any()) Utility.JsUtility.WarmAlert(this.Page, "获取合约条款失败", redirectUrl); contractClausesStr = GetMasterClause(contractClauses); } }
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; } }
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; } }