private void CacuCurPrice(SM_SALEORDERDTL cur) { cur.BASICPRICE = getItemPrice(cur.ITEMCODE, G.Core.GConvert.ToDecimal(cur.SIZEA)); //getMouldPrice(cur); getTColorPrice(cur); cur.LNPRICE = cur.BASICPRICE + cur.ADDPRICE; cur.PLANPRICE = cur.BASICPRICE + cur.ADDPRICE; CacuActPrice(cur); this.gGrid1.Refresh(); }
void dropdown_RowSelected(object sender, Interface.Event.DataRowEvent e) { if (e.DataRow != null) { SM_SALEORDERDTL cur = gGrid1.GetCurSelect <SM_SALEORDERDTL>(); cur.ITEMNAME = e.DataRow["ItemName"].ToString(); cur.ITEMCODE = e.DataRow["ItemCode"].ToString(); //CacuCurPrice(cur); } }
private void gGrid1_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (e.Col == 6 || e.Col == 1 || e.Col == 4 || e.Col == 5 || e.Col == 7 || e.Col == 8) { SM_SALEORDERDTL cur = gGrid1.GetCurSelect <SM_SALEORDERDTL>(); CacuCurPrice(cur); } if (e.Col == 10 || e.Col == 16) { SM_SALEORDERDTL cur = gGrid1.GetCurSelect <SM_SALEORDERDTL>(); CacuActPrice(cur); } }
//计算实际金额及行折扣 private void CacuActPrice(SM_SALEORDERDTL cur) { if (cur.BASICPRICE != 0) { cur.LNDISCOUNT = Decimal.Round((decimal)((cur.LNPRICE - cur.ADDPRICE) / cur.BASICPRICE), 4); } else { cur.LNDISCOUNT = 0; } cur.LNAMOUNT = cur.LNPRICE * cur.LNQTY; this.gGrid1.Refresh(); }
//private void getMouldPrice(SM_SALEORDERDTL cur) //{ // decimal v = 0; // var ml = from m in mouldlist // where m.MDCODE == cur.MOULDA || m.MDCODE == cur.MOULDB // select m.MDPRICE; // if (ml.ToArray().Count() <= 2) { // foreach (decimal d in ml) { // v += d; // } // } // cur.MOULDPRICE = v; //} private void getTColorPrice(SM_SALEORDERDTL cur) { decimal v = 0; var ml = from c in colorlist where c.CCODE == cur.TCOLORA || c.CCODE == cur.TCOLORB select c.ADDPRICE; if (ml.ToArray().Count() <= 2) { foreach (decimal d in ml) { v += d; } } cur.TCOLORPRICE = v; }
private void AddRow() { SM_SALEORDERDTL saledtl = gGrid1.AddRow <SM_SALEORDERDTL>(); saledtl.ORDLNNO = ((SM_SALEORDER)editData).SALEORDERDTL.Count; }