private Termspembayaran GetData() { Termspembayaran oData = new Termspembayaran(); oData.NamaSkema = txtSchemeName.Text; oData.GracePeriod = double.Parse(txtGradePeriode.Text); oData.UangMuka = double.Parse(txtDownPayment.Text); if (this.optionAnnualSelected != null) { oData.IdOptionAnnual = this.optionAnnualSelected.IdOptionAnnual; oData.Annual = this.optionAnnualSelected.Annual; } oData.TermPembayaran = int.Parse(txtDuration.Text); oData.BungaPerBulan = double.Parse(txtInterest.Text); if (this.paymentTermForm.termspembayaranSelected != null) { oData.IdTermPembayaran = this.paymentTermForm.termspembayaranSelected.IdTermPembayaran; } else if (this.newInvoice.termspembayaranSelected != null) { oData.IdTermPembayaran = this.newInvoice.termspembayaranSelected.IdTermPembayaran; } return(oData); }
public bool RemoveTermPembayaran(int id) { methodName = "RemoveTermPembayaran"; traceID = 1; using (var uow = new UnitOfWork(AppConfig.Current.ContextName)) { using (var trans = uow.BeginTransaction()) { try { traceID = 2; Termspembayaran oDBTermPembayaran = uow.Termspembayaran.SingleOrDefault(m => m.IdTermPembayaran == id); if (oDBTermPembayaran != null) { traceID = 3; uow.Termspembayaran.Remove(id); uow.Save(); } traceID = 5; trans.Commit(); } catch (Exception ex) { trans.Rollback(); throw new AppException(500, methodName, traceID, ex); } } } return(true); }
public bool EditTermPembayaran(Termspembayaran oData) { methodName = "EditTermPembayaran"; traceID = 1; using (var uow = new UnitOfWork(AppConfig.Current.ContextName)) { traceID = 2; var oDBData = uow.Termspembayaran.Get(oData.IdTermPembayaran); if (oDBData != null) { using (var trans = uow.BeginTransaction()) { try { traceID = 3; oDBData.MapFrom(oData); uow.Termspembayaran.Update(oDBData); uow.Save(); traceID = 4; trans.Commit(); } catch (Exception ex) { trans.Rollback(); throw new AppException(500, methodName, traceID, ex); } } } } return(true); }
public int AddTermPembayaran(Termspembayaran oData) { methodName = "AddTermPembayaran"; traceID = 1; using (var uow = new UnitOfWork(AppConfig.Current.ContextName)) { using (var trans = uow.BeginTransaction()) { try { traceID = 2; Termspembayaran oNewTermspembayaran = new Termspembayaran(); oNewTermspembayaran.MapFrom(oData); oNewTermspembayaran = uow.Termspembayaran.Add(oNewTermspembayaran); uow.Save(); traceID = 3; oData.IdTermPembayaran = oNewTermspembayaran.IdTermPembayaran; trans.Commit(); } catch (Exception ex) { trans.Rollback(); throw new AppException(500, methodName, traceID, ex); } } } return(oData.IdTermPembayaran); }
private void DGPaymentTerm_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.termsPembayaranSelected = null; if (DGSPaymentTerm.SelectedItem != null) { this.termsPembayaranSelected = (Termspembayaran)DGSPaymentTerm.SelectedItem; } }
private void payment_selectedchange(object sender, SelectionChangedEventArgs e) { this.termspembayaranSelected = null; if (cbPayment.SelectedItem != null) { termspembayaranSelected = (Termspembayaran)cbPayment.SelectedItem; } }
private void payment_selectedchange(object sender, SelectionChangedEventArgs e) { this.termspembayaranSelected = null; if (cbPayment.SelectedItem != null) { termspembayaranSelected = (Termspembayaran)cbPayment.SelectedItem; txtuangmuka.Text = this.termspembayaranSelected.UangMuka.ToString(); txtPaid.Text = (float.Parse(txtuangmuka.Text) * float.Parse(txtAfterTotalTax.Text)).ToString(); txtInstallments.Text = this.termspembayaranSelected.TermPembayaran.ToString(); } }
private void Delete_Click(object sender, RoutedEventArgs e) { if (this.termsPembayaranSelected == null) { MessageBox.Show("Payment Terms not selected !"); } else { TermspembayaranBLL TermsPembayaranBLL = new TermspembayaranBLL(); if (TermsPembayaranBLL.RemoveTermPembayaran(this.termsPembayaranSelected.IdTermPembayaran) == true) { MessageBox.Show("Payment Terms successfully deleted"); this.LoadTermspembayaran(); this.termsPembayaranSelected = null; } } }
private void ClearForm() { this.termsPembayaranSelected = null; }