private void Related() { DialogResult yn = oFrm.ShowDialog(); if (yn == DialogResult.OK) { this.DROP_CUSTID.SetValue(oFrm.ds.Tables[0].Rows[0]["CUSTID"]); this.DROP_INVCUSTID.SetValue(oFrm.ds.Tables[0].Rows[0]["INVCUSTID"]); this.DROP_SALEREP.SetValue(oFrm.ds.Tables[0].Rows[0]["SALESMAN"]); SM_XSKP xskp = this.editData as SM_XSKP; xskp.XSKPDTL.Clear(); foreach (DataRow dr in oFrm.ds.Tables[0].Select("ISSELECT=1")) { SM_XSKPDTL xskpdtl = new SM_XSKPDTL(); xskpdtl.ORDERID = G.Core.GConvert.ToString(dr["ORDERID"]); xskpdtl.ITEMCODE = G.Core.GConvert.ToString(dr["ITEMCODE"]); xskpdtl.ITEMNAME = G.Core.GConvert.ToString(dr["ITEMNAME"]); xskpdtl.JLDW = G.Core.GConvert.ToString(dr["JLDW"]); xskpdtl.QTY = G.Core.GConvert.ToDecimal(dr["QTY"]); xskpdtl.ATPRICE = G.Core.GConvert.ToDecimal(dr["ATPRICE"]); xskpdtl.ATMONEY = G.Core.GConvert.ToDecimal(dr["ATMONEY"]); xskpdtl.OTPRICE = G.Core.GConvert.ToDecimal(dr["OTPRICE"]); xskpdtl.OTMONEY = G.Core.GConvert.ToDecimal(dr["OTMONEY"]); xskpdtl.TAXMONEY = G.Core.GConvert.ToDecimal(dr["TAXMONEY"]); xskpdtl.SALEORDERDTLID = G.Core.GConvert.ToInt(dr["ID"]); xskpdtl.TAXRATE = 17; xskp.XSKPDTL.Add(xskpdtl); } this.gGrid1.SetValue <SM_XSKPDTL>(xskp.XSKPDTL); } ExecuteSum(); this.Refresh(); }
private void gGrid1_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (e.Col == 8) { SM_XSKPDTL dtl = gGrid1.GetCurSelect <SM_XSKPDTL>(); if (dtl.QTY == 0) { MessageBox.Show("数量不能为0!"); return; } dtl.OTMONEY = dtl.ATMONEY / (1 + dtl.TAXRATE / 100); dtl.OTPRICE = (dtl.ATMONEY / (1 + dtl.TAXRATE / 100)) / dtl.QTY; dtl.TAXMONEY = dtl.ATMONEY - dtl.OTMONEY;//dtl.TAXRATE * dtl.ATMONEY / (100 + dtl.TAXRATE); ExecuteSum(); this.gGrid1.Refresh(); } }
public override void AddRow() { SM_XSKPDTL shipvoucherdtl = gGrid1.AddRow <SM_XSKPDTL>(); }