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) { 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; } }
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 = "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) { 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) { 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) { 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()); } }