private void txtChequeNo_GotFocus(object sender, RoutedEventArgs e) { if (doc.ChequeID.Equals("")) { return; } UTextBox txt = sender as UTextBox; MAccountDocPayment pmt = (MAccountDocPayment)txt.Tag; if (pmt.ChequeID.Equals(doc.ChequeID)) { return; } MCheque cheq = getChequeByID(doc.ChequeID); if (cheq == null) { pmt.ChequeNo = ""; pmt.PaidAmount = "0.00"; pmt.ChequeID = ""; pmt.ChequeNo = ""; } else { pmt.ChequeNo = cheq.ChequeNo; pmt.BankID = cheq.ChequeBankID; pmt.PaidAmount = cheq.ChequeAmount; pmt.ChequeID = cheq.ChequeID; } }
public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData() { MAccountDocPayment mp = model as MAccountDocPayment; CTable tb = model.GetDbObject(); tb.SetFieldValue("CHUNK_FLAG", "Y"); tb.SetFieldValue("OWNER_FLAG", "Y"); tb.SetFieldValue("DOCUMENT_STATUS", "2"); tb.SetFieldValue("IS_NULL_REFUND_STATUS", "Y"); tb.SetFieldValue("REFUND_STATUS", ""); items = OnixWebServiceAPI.GetListAPI("GetPaymentTransactionList", "PAYMENT_TRANSACTION_LIST", tb); lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned(); itemSources.Clear(); int idx = 0; foreach (CTable o in items) { MAccountDocPayment v = new MAccountDocPayment(o); v.RowIndex = idx; itemSources.Add(v); idx++; } Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources); return(tuple); }
private void cmdClear_Click(object sender, RoutedEventArgs e) { MAccountDocPayment v = (MAccountDocPayment)(sender as Button).Tag; doc.RemoveAccountDocPayment(v); calculateAssociateAmount(); doc.IsModified = true; }
private Boolean validatePayment <T>(ObservableCollection <T> collection) where T : MBaseModel { int idx = 0; foreach (MBaseModel c in collection) { if (c.ExtFlag.Equals("D")) { continue; } if ((c as MAccountDocPayment).Direction.Equals("2")) { //Changes continue; } idx++; MAccountDocPayment bi = (MAccountDocPayment)c; if (bi.PaymentType.Equals("")) { CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null); return(false); } if (!bi.PaymentType.Equals("1")) { if (bi.BankID.Equals("")) { CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null); return(false); } if (!bi.PaymentType.Equals("4")) { if (bi.CashAccountID.Equals("")) { CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null); return(false); } } } if (bi.PaidAmount.Equals("")) { CHelper.ShowErorMessage(idx.ToString(), "ERROR_SELECTION_TYPE", null); return(false); } } return(true); }
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { TextBox tb = (sender as TextBox); MAccountDocPayment pmt = (MAccountDocPayment)tb.Tag; if (pmt == null) { return; } //pmt.PaidAmount = tb.Text; calculateAssociateAmount(); doc.IsModified = true; }
private void txtChequeNo_TextSelected(object sender, EventArgs e) { UTextBox txt = sender as UTextBox; MAccountDocPayment pmt = (MAccountDocPayment)txt.Tag; String code = txt.Text; MCheque cheq = getCheque(code); if (cheq == null) { pmt.ChequeNo = ""; pmt.PaidAmount = "0.00"; pmt.ChequeID = ""; } else { pmt.BankID = cheq.ChequeBankID; pmt.PaidAmount = cheq.ChequeAmount; pmt.ChequeID = cheq.ChequeID; } }
private void cmdAdd_Click(object sender, RoutedEventArgs e) { MAccountDocPayment pmt = new MAccountDocPayment(new CTable("")); pmt.PaymentType = "1"; pmt.Direction = "1"; pmt.RefundStatus = "1"; if (IsAr) { pmt.Category = "1"; } else { pmt.Category = "2"; } doc.AddAccountDocPayment(pmt); calculateAssociateAmount(); doc.IsModified = true; }
public CDocPayment(MAccountDocPayment di, String lang) { mi = di; Lang = lang; }