public void itemGrid_GridCustomerPostBackEvent(object sender, GridCustomerPostBackEventArgs e) { if (e.ColIndex == -1) { return; } if (e.RowIndex == -1) { return; } this.DataGrid5.CollectData(); this.DataGrid5.BindData(); DataTable dt = this.CurrentState["BillNoAllocationShip"] as DataTable;//参照中选择的数据 if (dt != null && dt.Rows.Count > 0) { BilAlllcationShipPlanViewRecord recourd = null; recourd = this.Model.BilAlllcationShipPlanView.FocusedRecord; // if(recourd.ShipPlanDetailHead != null && recourd.ShipPlanDetailHead != long.Parse(dt.Rows[0]["ID"].ToString()) recourd.ShipPlanDetailHead = long.Parse(dt.Rows[0]["ID"].ToString()); recourd.ShipPlanDetailHead_DocNo = dt.Rows[0]["DocNo"].ToString(); recourd.Date = DateTime.Parse(dt.Rows[0]["Date"].ToString()); recourd.Customer = long.Parse(dt.Rows[0]["Customer"].ToString()); recourd.Customer_Code = dt.Rows[0]["Customer_Code"].ToString(); recourd.Customer_Name = dt.Rows[0]["Customer_Name"].ToString(); recourd.Org = long.Parse(dt.Rows[0]["Org"].ToString()); recourd.Org_Code = dt.Rows[0]["Org_Code"].ToString(); recourd.Org_Name = dt.Rows[0]["Org_Name"].ToString(); recourd.ParkingType = dt.Rows[0]["ParkingType"].ToString(); recourd.BillNoItem = long.Parse(dt.Rows[0]["BillNoItem"].ToString()); recourd.BillNoItem_Code = dt.Rows[0]["BillNoItem_Name"].ToString(); recourd.BillNoItem_Name = dt.Rows[0]["BillNoItem_Name"].ToString(); recourd.IsSelected = true; for (int i = 1; i < dt.Rows.Count; i++) { recourd = this.Model.BilAlllcationShipPlanView.AddNewUIRecord(); recourd.ShipPlanDetailHead = long.Parse(dt.Rows[i]["ID"].ToString()); recourd.ShipPlanDetailHead_DocNo = dt.Rows[i]["DocNo"].ToString(); recourd.Date = DateTime.Parse(dt.Rows[i]["Date"].ToString()); recourd.Customer = long.Parse(dt.Rows[i]["Customer"].ToString()); recourd.Customer_Code = dt.Rows[i]["Customer_Code"].ToString(); recourd.Customer_Name = dt.Rows[i]["Customer_Name"].ToString(); recourd.Org = long.Parse(dt.Rows[i]["Org"].ToString()); recourd.Org_Code = dt.Rows[i]["Org_Code"].ToString(); recourd.Org_Name = dt.Rows[i]["Org_Name"].ToString(); recourd.ParkingType = dt.Rows[i]["ParkingType"].ToString(); recourd.BillNoItem = long.Parse(dt.Rows[i]["BillNoItem"].ToString()); recourd.BillNoItem_Code = dt.Rows[i]["BillNoItem_Name"].ToString(); recourd.BillNoItem_Name = dt.Rows[i]["BillNoItem_Name"].ToString(); recourd.IsSelected = true; } } this.CurrentState["BillNoAllocationShip"] = null; this.DataGrid5.CollectData(); this.DataGrid5.BindData(); }
// 页面进入时,默认为对新的出运明细单进行发票号的分配,默认加载出运明细单.单据状态=审核中 and 出运明细单.已分配发票号=false的所有出运明细单; private void LoadShipPlanDoc() { //if (this.Model.BillNoItemHead.FocusedRecord == null && this.Model.BilAlllcationShipPlanView.RecordCount > 0) // return; UFIDA.U9.Cust.GS.FT.OperateShipPlanBP.Proxy.GetShipPlanDocProxy proxy = new OperateShipPlanBP.Proxy.GetShipPlanDocProxy(); List <UFIDA.U9.Cust.GS.FT.OperateShipPlanBP.ShipPlanByBillHeadDTOData> listShipPlan = new List <OperateShipPlanBP.ShipPlanByBillHeadDTOData>(); if (this.CurrentState["BillNoRefAllocation"] != null) { this.Model.BilAlllcationShipPlanView.Clear(); proxy.BillNoItemHead = (long)this.CurrentState["BillNoRefAllocation"]; } else if (this.NameValues != null && this.NameValues["BillNoItem"] != null && (this.Model.BilAlllcationShipPlanView.RecordCount <= 0 || this.Model.BilAlllcationShipPlanView.RecordCount == 1 && this.Model.BilAlllcationShipPlanView.FocusedRecord.ID == -2)) { this.Model.BilAlllcationShipPlanView.Clear(); proxy.BillNoItemHead = Convert.ToInt64(this.NameValues["BillNoItem"].ToString()); //this.Model.BillNoItemHead.Clear(); //this.Model.BillNoItemHead.CurrentFilter.OPath = this.Model.BillNoItemHead.FieldBillNoItemID.AttributeName + "='" + this.NameValues["BillNoItem"].ToString() + "'"; //this.Action.CommonAction.Load(this.Model.BillNoItemHead); this.Action.NavigateAction.MovePageAt(null, Convert.ToInt64(this.NameValues["BillNoItem"].ToString())); } else if (this.CurrentState["Cust_BillNoShipPlan"] != null) { BilAlllcationShipPlanViewRecord recourd = null; if (this.Model.BilAlllcationShipPlanView.FocusedRecord != null) { recourd = this.Model.BilAlllcationShipPlanView.FocusedRecord; } else { recourd = this.Model.BilAlllcationShipPlanView.AddNewUIRecord(); } recourd.ShipPlanDetailHead = Convert.ToInt64(this.NameValues["ShipPlanDetailHead"]); recourd.ShipPlanDetailHead_DocNo = this.NameValues["ShipPlanDetailHead_DocNo"].ToString(); recourd.Date = DateTime.Parse(this.NameValues["Date"].ToString()); recourd.Customer = Convert.ToInt64(this.NameValues["Customer"]); recourd.Customer_Code = this.NameValues["Customer_Code"].ToString(); recourd.Customer_Name = this.NameValues["Customer_Name"].ToString(); recourd.Org = Convert.ToInt64(this.NameValues["Org"]); recourd.Org_Code = this.NameValues["Org_Code"].ToString(); recourd.Org_Name = this.NameValues["Org_Name"].ToString(); recourd.Currency = this.NameValues["Currency"].ToString(); recourd.SaleMan = this.NameValues["SaleMan"].ToString(); recourd.ParkingType = this.NameValues["ParkingType"].ToString(); recourd.BillNoItem = this.NameValues["CustBillNoItem"].ToString() == "" ?0: Convert.ToInt64(this.NameValues["CustBillNoItem"]); recourd.BillNoItem_Code = this.NameValues["CustBillNoItem_Name"].ToString(); recourd.BillNoItem_Name = this.NameValues["CustBillNoItem_Name"].ToString(); this.CurrentState["Cust_BillNoShipPlan"] = null; return; } else { return; } proxy.Type = 0; listShipPlan = proxy.Do(); if (listShipPlan != null) { BilAlllcationShipPlanViewRecord recourd = this.Model.BilAlllcationShipPlanView.FocusedRecord; foreach (UFIDA.U9.Cust.GS.FT.OperateShipPlanBP.ShipPlanByBillHeadDTOData shipDoc in listShipPlan) { recourd = this.Model.BilAlllcationShipPlanView.AddNewUIRecord(); recourd.ShipPlanDetailHead = shipDoc.ShipPlan; recourd.ShipPlanDetailHead_DocNo = shipDoc.DocNo; recourd.Date = shipDoc.Date; recourd.Customer = shipDoc.Customer; recourd.Customer_Code = shipDoc.Customer_Code; recourd.Customer_Name = shipDoc.Customer_Name; recourd.Org = shipDoc.Org; recourd.Org_Code = shipDoc.Org_Code; recourd.Org_Name = shipDoc.Org_Name; recourd.Currency = shipDoc.Currenty.ToString(); recourd.SaleMan = shipDoc.SaleMan.ToString(); recourd.ParkingType = shipDoc.PackagingType; recourd.BillNoItem = shipDoc.BillNoItem; recourd.BillNoItem_Code = shipDoc.BillNoItem_Name; recourd.BillNoItem_Name = shipDoc.BillNoItem_Name; } } this.CurrentState["BillNoRefAllocation"] = null; }