private void DROP_POID_RowSelect(object sender, Interface.Event.DataRowEvent e) { if (e.DataRow != null) { try { this.DROP_SUPCODE.Text = G.Core.GConvert.ToString(e.DataRow["SUPPNAME"]); this.DROP_SUPCODE.Value = G.Core.GConvert.ToString(e.DataRow["SUPCODE"]); string poid = G.Core.GConvert.ToString(e.DataRow["POID"]); G.BLL.ERP.Purchase.SM_PORDERLogic porderlogic = new G.BLL.ERP.Purchase.SM_PORDERLogic(); SM_PORDER pobj = porderlogic.ExecuteSelect(CK.K["POID"].Eq(poid), OrderBy.Parse("POID"), 0, 0)[0]; if (pobj != null) { //SM_SHIPVOUCHER shipv = this.editData as SM_SHIPVOUCHER; //shipv.SHIPVOUCHERDTL.Clear(); BindingList <SM_SHIPVOUCHERDTL> shipvd = this.gGrid1.DataSource as BindingList <SM_SHIPVOUCHERDTL>; shipvd.Clear(); foreach (SM_PORDERDTL r in pobj.PORDERDTL) { if (r.PREPURQTY > r.SHIFTQTY) { G.BLL.ERP.BaseData.DM_ITEMLogic itemlogic = new G.BLL.ERP.BaseData.DM_ITEMLogic(); DM_ITEM itemobj = itemlogic.ExecuteSelect(CK.K["ITEMCODE"].Eq(r.ITEMCODE), OrderBy.Parse("ITEMCODE"), 0, 0)[0]; SM_SHIPVOUCHERDTL shipd = new SM_SHIPVOUCHERDTL(); shipd.POLNNO = r.POLNNO; shipd.ITEMCODE = r.ITEMCODE; shipd.ITEMNAME = r.ITEMNAME; shipd.INVUNIT = r.INVUNIT; shipd.PREPURQTY = r.PREPURQTY; shipd.PRICE = r.PURPRICE; shipd.ATTRIBUTEA = r.ATTRIBUTEA; shipd.ATTRIBUTEB = r.ATTRIBUTEB; shipd.ATTRIBUTEBNAME = r.ATTRIBUTEBNAME; shipd.ATTRIBUTEC = r.ATTRIBUTEC; shipd.WRHSCODE = itemobj.WrhsCode; shipd.WRHSNAME = itemobj.WRHSNAME; shipd.LOCCODE = itemobj.LocCode; shipd.LOCNAME = itemobj.LOCNAME; shipd.UNFINISHQTY = r.PREPURQTY - r.SHIFTQTY; shipd.ISATTRIBUTEA = (bool)itemobj.IsAttributeA; shipd.ISATTRIBUTEB = (bool)itemobj.IsAttributeB; shipd.ISATTRIBUTEC = (bool)itemobj.IsAttributeC; shipvd.Add(shipd); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } } gGrid1.Refresh(); }
private void gGrid1_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (G.Core.GConvert.ToBool(this.CHECK_ISPRICEDIFF.GetValue()) == false) { if (e.Col == 7 || e.Col == 8) { SM_SHIPVOUCHERDTL dtl = gGrid1.GetCurSelect <SM_SHIPVOUCHERDTL>(); dtl.SHIPAMOUNT = dtl.PRICE * dtl.CHECKEDQTY; this.gGrid1.Refresh(); } if (e.Col == 9) { SM_SHIPVOUCHERDTL dtl = gGrid1.GetCurSelect <SM_SHIPVOUCHERDTL>(); dtl.SHIPAMOUNT = dtl.PRICE * dtl.CHECKEDQTY; this.gGrid1.Refresh(); MessageBox.Show("不是补差价单,不能更改金额!"); } } else { if (e.Col == 6 || e.Col == 7 || e.Col == 8) { SM_SHIPVOUCHERDTL dtl = gGrid1.GetCurSelect <SM_SHIPVOUCHERDTL>(); dtl.PREPURQTY = 0; dtl.CHECKEDQTY = 0; dtl.PRICE = 0; this.gGrid1.Refresh(); MessageBox.Show("补差价单,数量、单价应为零,不能更改!"); } if (e.Col == 9) { SM_SHIPVOUCHERDTL dtl = gGrid1.GetCurSelect <SM_SHIPVOUCHERDTL>(); dtl.PREPURQTY = 0; dtl.CHECKEDQTY = 0; dtl.PRICE = 0; this.gGrid1.Refresh(); } } if (e.Col == 11) { dropLocation.DefaultCondition = CK.K["WRHSCODE"].Eq(dropWarehouse.Value); } }
public override void AddRow() { SM_SHIPVOUCHERDTL shipvoucherdtl = gGrid1.AddRow <SM_SHIPVOUCHERDTL>(); }