private Boolean validateDiscount <T>(ObservableCollection <T> collection) where T : MBaseModel { int idx = 0; foreach (MBaseModel c in collection) { if (c.ExtFlag.Equals("D")) { continue; } idx++; MAccountDocDiscount bi = (MAccountDocDiscount)c; if (bi.DiscountType.Equals("")) { CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null); return(false); } if (bi.DiscountAmt.Equals("")) { CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null); return(false); } } return(true); }
private void cmdClear_Click(object sender, RoutedEventArgs e) { MAccountDocDiscount v = (MAccountDocDiscount)(sender as Button).Tag; doc.RemoveAccountDocDiscount(v); calculateAssociateAmount(); doc.IsModified = true; }
private void cmdAdd_Click(object sender, RoutedEventArgs e) { MAccountDocDiscount disc = new MAccountDocDiscount(new CTable("")); doc.AddAccountDocDiscount(disc); calculateAssociateAmount(); doc.IsModified = true; }
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { TextBox tb = (sender as TextBox); MAccountDocDiscount disc = (MAccountDocDiscount)tb.Tag; if (disc == null) { return; } calculateAssociateAmount(); doc.IsModified = true; }