private Kontak GetData() { string message = ""; if (this.KlasifikasiKontakSelected == null) { message += "Klasifikasi kontak belum dipilih\n"; } if (string.IsNullOrEmpty(txtEmployeeID.Text)) { message += "Employee Id belum diisi\n"; } if (string.IsNullOrEmpty(txtName.Text)) { message += "Nama Employee belum diisi\n"; } Kontak oData = new Kontak(); oData.IdTypeKontak = this.TypeKontak.Id; oData.TypeKontak = this.TypeKontak.Type; if (this.KlasifikasiKontakSelected != null) { oData.IdKlasifikasiKontak = this.KlasifikasiKontakSelected.Id; oData.KlasifikasiKontak = this.KlasifikasiKontakSelected.NamaKlasifikasiKontak; } oData.KontakID = txtEmployeeID.Text; oData.NamaA = txtName.Text; oData.NoHPA = txtPhone.Text; oData.EmailA = txtEmail.Text; oData.IdUserId = null; oData.RealTimeRecording = DateTime.Now; return(oData); }
private Kontak GetData() { string message = ""; if (this.KlasifikasiKontakSelected == null) { message += "Contact classification has not been selected\n"; } if (string.IsNullOrEmpty(txtVendorID.Text)) { message += "Vendor Id not yet filled\n"; } if (string.IsNullOrEmpty(txtName.Text)) { message += "Vendor Name not yet filled\n"; } Kontak oData = new Kontak(); oData.IdTypeKontak = this.TypeKontak.Id; oData.TypeKontak = this.TypeKontak.Type; if (this.KlasifikasiKontakSelected != null) { oData.IdKlasifikasiKontak = this.KlasifikasiKontakSelected.Id; oData.KlasifikasiKontak = this.KlasifikasiKontakSelected.NamaKlasifikasiKontak; } oData.KontakID = txtVendorID.Text; oData.NamaA = txtName.Text; oData.NoHPA = txtPhone.Text; oData.EmailA = txtEmail.Text; oData.RealTimeRecording = DateTime.Now; return(oData); }
private void Cbvendor_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.kontakselected = null; if (cbvendor.SelectedItem != null) { this.kontakselected = (Kontak)cbvendor.SelectedItem; } }
private void cbkontak_change(object sender, SelectionChangedEventArgs e) { this.kontakSelected = null; if (srkontak.SelectedItem != null) { this.kontakSelected = (Kontak)srkontak.SelectedItem; } }
private void staff_selectedchange(object sender, SelectionChangedEventArgs e) { this.petugasSelected = null; if (srstaff.SelectedItem != null) { this.petugasSelected = (Kontak)srstaff.SelectedItem; } }
private void staff_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.kontakSelecteds = null; if (srstaff.SelectedItem != null) { this.kontakSelecteds = (Kontak)srstaff.SelectedItem; } }
private void Cbkontak_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.kontakSelected = null; if (srkontak.SelectedItem != null) { this.kontakSelected = (Kontak)srkontak.SelectedItem; txtemail.Text = this.kontakSelected.EmailA; txthp.Text = this.kontakSelected.NoHPA; } }
public bool EditKontak(Kontak oData) { methodName = "EditKontak"; traceID = 1; using (var uow = new UnitOfWork(AppConfig.Current.ContextName)) { traceID = 2; var oDBData = uow.Kontak.Get(oData.Id); if (oDBData != null) { using (var trans = uow.BeginTransaction()) { try { traceID = 3; oDBData.MapFrom(oData); uow.Kontak.Update(oDBData); traceID = 4; var oDBListData = uow.ListKontak.SingleOrDefault(m => m.IdKontak == oData.Id); if (oDBListData != null) { traceID = 5; int idListKontak = oDBListData.Id; oDBListData.MapFrom(oData); oDBListData.Id = idListKontak; oDBListData.IdKontak = oData.Id; traceID = 6; uow.ListKontak.Update(oDBListData); } else { ListKontak oNewListKontak = new ListKontak(); oNewListKontak.MapFrom(oData); oNewListKontak.IdKontak = oData.Id; uow.ListKontak.Add(oNewListKontak); } traceID = 7; uow.Save(); trans.Commit(); } catch (Exception ex) { trans.Rollback(); throw new AppException(500, methodName, traceID, ex); } } } } return(true); }
private void ClearForm() { tgl.Text = DateTime.Now.ToShortDateString(); cbCashAccount.SelectedIndex = -1; cbSalaryAccount.SelectedIndex = -1; chktax.IsChecked = false; cbTaxAccount.SelectedIndex = -1; txtTotalPaymentValue.Text = ""; this.kontakSelected = null; srkontak.Text = ""; }
private Kontak GetData() { string message = ""; if (this.KlasifikasiKontakSelected == null) { message += "Contact classification has not been selected\n"; } if (string.IsNullOrEmpty(txtVendorID.Text)) { message += "Vendor Id not yet filled\n"; } if (string.IsNullOrEmpty(txtName.Text)) { message += "Vendor Name not yet filled\n"; } Kontak oData = new Kontak(); oData.IdTypeKontak = this.TypeKontak.Id; oData.TypeKontak = this.TypeKontak.Type; if (this.KlasifikasiKontakSelected != null) { oData.IdKlasifikasiKontak = this.KlasifikasiKontakSelected.Id; oData.KlasifikasiKontak = this.KlasifikasiKontakSelected.NamaKlasifikasiKontak; } oData.KontakID = txtVendorID.Text; oData.NamaA = txtName.Text; oData.NoHPA = txtPhone.Text; oData.EmailA = txtEmail.Text; oData.GenderA = rdMale.IsChecked == true ? true : false; if (this.NegaraSelected != null) { oData.IdNegaraA = this.NegaraSelected.Id; oData.NegaraA = this.NegaraSelected.Nama; } oData.AlamatA = txtAddress.Text; oData.KotaA = txtCity.Text; if (this.PropinsiSelected != null) { oData.IdPropinsiA = this.PropinsiSelected.Id; oData.PropinsiA = this.PropinsiSelected.Nama; } oData.KodePosA = txtZip.Text; oData.MapLocationA = txtMap.Text; oData.PositionA = txtPosition.Text; oData.KeteranganA = txtNote.Text; oData.UploadPhotoA = this.Photo; oData.RealTimeRecording = DateTime.Now; return(oData); }
private void employee_selectedchange(object sender, SelectionChangedEventArgs e) { this.kontakSelected = null; if (sremployee.SelectedItem != null) { this.kontakSelected = (Kontak)sremployee.SelectedItem; txtemail.Text = this.kontakSelected.EmailA; txthp.Text = this.kontakSelected.NoHPA; txtsalary.Text = this.kontakSelected.GajiPokok.ToString(); txttunjangan.Text = this.kontakSelected.Tunjangan.ToString(); txtovertimehour.Text = this.kontakSelected.OvertimeHour.ToString(); } }
private void ClearForm() { Tanggaljurnalumum.Text = DateTime.Now.ToShortDateString(); this.dokumenSelected = null; srnodokumen.Text = ""; nojurnal.Text = ""; this.dataMataUangselected = null; cbcurrency.SelectedIndex = -1; txtnote.Text = ""; txttotaldebit.Text = "0"; txttotalkredit.Text = "0"; txtbalance.Text = "0"; this.kontakSelected = null; srstaff.Text = ""; }
private void Delete_Click(object sender, RoutedEventArgs e) { if (this.KontakSelected == null) { MessageBox.Show("Employee belum dipilih!"); } else { KontakBLL KontakBLL = new KontakBLL(); if (KontakBLL.RemoveKontak(this.KontakSelected.Id) == true) { MessageBox.Show("Employee berhasil dihapus"); this.LoadKontak(""); this.KontakSelected = null; } } }
public int AddKontak(Kontak oData) { methodName = "AddKontak"; traceID = 1; using (var uow = new UnitOfWork(AppConfig.Current.ContextName)) { using (var trans = uow.BeginTransaction()) { try { traceID = 2; Kontak oNewKontak = new Kontak(); oNewKontak.MapFrom(oData); oNewKontak = uow.Kontak.Add(oNewKontak); uow.Save(); traceID = 3; oData.Id = oNewKontak.Id; if (oData.Id > 0) { traceID = 4; ListKontak oNewListKontak = new ListKontak(); oNewListKontak.MapFrom(oData); oNewListKontak.IdKontak = oData.Id; uow.ListKontak.Add(oNewListKontak); } traceID = 5; uow.Save(); trans.Commit(); } catch (Exception ex) { trans.Rollback(); throw new AppException(500, methodName, traceID, ex); } } } return(oData.Id); }
public bool RemoveKontak(int id) { methodName = "RemoveKontak"; traceID = 1; using (var uow = new UnitOfWork(AppConfig.Current.ContextName)) { using (var trans = uow.BeginTransaction()) { try { traceID = 2; Kontak oDBKontak = uow.Kontak.SingleOrDefault(m => m.Id == id); if (oDBKontak != null) { traceID = 3; uow.Kontak.Remove(id); var oDBListKontak = uow.ListKontak.SingleOrDefault(m => m.IdKontak == id); if (oDBListKontak != null) { uow.ListKontak.Remove(oDBListKontak.Id); } uow.Save(); } traceID = 5; trans.Commit(); } catch (Exception ex) { trans.Rollback(); throw new AppException(500, methodName, traceID, ex); } } } return(true); }
private void LiDataEmployee_SelectionChanged(object sender, SelectionChangedEventArgs e) { this.ClearForm(); if (LiDataEmployee.SelectedItem != null) { this.KontakSelected = (Kontak)LiDataEmployee.SelectedItem; if (this.KontakSelected != null) { using (var uow = new UnitOfWork(AppConfig.Current.ContextName)) { txtName.Text = this.KontakSelected.NamaA; txtType.Text = this.KontakSelected.TypeKontak; txtEmployeeID.Text = this.KontakSelected.KontakID; txtPhone.Text = this.KontakSelected.NoHPA; txtEmail.Text = this.KontakSelected.EmailA; txtGender.Text = "Male"; if (this.KontakSelected.GenderA != true) { txtGender.Text = "Female"; } txtCountry.Text = this.KontakSelected.NegaraA; txtAddress.Text = this.KontakSelected.AlamatA; txtCity.Text = this.KontakSelected.KotaA; txtState.Text = this.KontakSelected.PropinsiA; txtZip.Text = this.KontakSelected.KodePosA; txtMap.Text = this.KontakSelected.MapLocationA; txtPosition.Text = this.KontakSelected.PositionA; txtSalaryGroup.Text = this.KontakSelected.NamaGolongan; txtWork.Text = this.KontakSelected.Lokasi; txtDepartment.Text = this.KontakSelected.NamaDepartemen; txtProject.Text = this.KontakSelected.Proyek; txtTaxID.Text = this.KontakSelected.NPWPA; txtBankName.Text = this.KontakSelected.NamaBankA; txtAccountNo.Text = this.KontakSelected.NoRekA.ToString(); txtAccountName.Text = this.KontakSelected.NamaBukuRekening; txtRemarks.Text = this.KontakSelected.KeteranganA; if (!string.IsNullOrEmpty(this.KontakSelected.UploadPhotoA)) { imgPhoto.Source = new BitmapImage(new Uri(Path.GetFullPath(this.KontakSelected.UploadPhotoA))); } if (this.KontakSelected != null) { var oKlasifikasi = uow.KlasifikasiKontak.Get(this.KontakSelected.IdKlasifikasiKontak.GetValueOrDefault(0)); if (oKlasifikasi != null) { if (oKlasifikasi.CheckboxPIC1 == true) { tabPIC1.IsEnabled = true; txtNamePIC1.Text = this.KontakSelected.NamaB; txtPhonePIC1.Text = this.KontakSelected.NoHPB; txtEmailPIC1.Text = this.KontakSelected.EmailB; if (oKlasifikasi.CheckboxGenderPIC1 == true) { txtGenderPIC1.Text = "Male"; if (this.KontakSelected.GenderB != true) { txtGenderPIC2.Text = "Female"; } } txtAddressPIC1.Text = this.KontakSelected.AlamatB; txtCityPIC1.Text = this.KontakSelected.KotaB; txtStatePIC1.Text = this.KontakSelected.PropinsiB; txtZipPIC1.Text = this.KontakSelected.KodePosB; txtMapPIC1.Text = this.KontakSelected.MapLocationB; if (oKlasifikasi.CheckboxPositionPIC1 == true) { txtPositionPIC1.Text = this.KontakSelected.PositionB; } txtRemarksPIC1.Text = this.KontakSelected.KeteranganB; if (!string.IsNullOrEmpty(this.KontakSelected.UploadPhotoB)) { imgPhotoPIC1.Source = new BitmapImage(new Uri(Path.GetFullPath(this.KontakSelected.UploadPhotoB))); } } if (oKlasifikasi.CheckboxPIC2 == true) { tabPIC2.IsEnabled = true; txtNamePIC2.Text = this.KontakSelected.NamaC; txtPhonePIC2.Text = this.KontakSelected.NoHPC; txtEmailPIC2.Text = this.KontakSelected.EmailC; if (oKlasifikasi.CheckboxGenderPIC2 == true) { txtGenderPIC2.Text = "Male"; if (this.KontakSelected.GenderB != true) { txtGenderPIC2.Text = "Female"; } } txtAddressPIC2.Text = this.KontakSelected.AlamatC; txtCityPIC2.Text = this.KontakSelected.KotaC; txtStatePIC2.Text = this.KontakSelected.PropinsiC; txtZipPIC2.Text = this.KontakSelected.KodePosC; txtMapPIC2.Text = this.KontakSelected.MapLocationC; if (oKlasifikasi.CheckboxPositionPIC2 == true) { txtPositionPIC2.Text = this.KontakSelected.PositionC; } txtRemarksPIC2.Text = this.KontakSelected.KeteranganC; if (!string.IsNullOrEmpty(this.KontakSelected.UploadPhotoC)) { imgPhotoPIC2.Source = new BitmapImage(new Uri(Path.GetFullPath(this.KontakSelected.UploadPhotoC))); } } if (oKlasifikasi.CheckboxPIC3 == true) { tabPIC3.IsEnabled = true; txtNamePIC3.Text = this.KontakSelected.NamaD; txtPhonePIC3.Text = this.KontakSelected.NoHPD; txtEmailPIC3.Text = this.KontakSelected.EmailD; if (oKlasifikasi.CheckboxGenderPIC3 == true) { txtGenderPIC3.Text = "Male"; if (this.KontakSelected.GenderB != true) { txtGenderPIC2.Text = "Female"; } } txtAddressPIC3.Text = this.KontakSelected.AlamatD; txtCityPIC3.Text = this.KontakSelected.KotaD; txtStatePIC3.Text = this.KontakSelected.PropinsiD; txtZipPIC3.Text = this.KontakSelected.KodePosD; txtMapPIC3.Text = this.KontakSelected.MapLocationD; if (oKlasifikasi.CheckboxPositionPIC3 == true) { txtPositionPIC3.Text = this.KontakSelected.PositionD; } txtRemarksPIC3.Text = this.KontakSelected.KeteranganD; if (!string.IsNullOrEmpty(this.KontakSelected.UploadPhotoC)) { imgPhotoPIC3.Source = new BitmapImage(new Uri(Path.GetFullPath(this.KontakSelected.UploadPhotoC))); } } } } } } } }
private void ClearForm() { this.KontakSelected = null; txtName.Text = ""; txtType.Text = ""; txtEmployeeID.Text = ""; txtPhone.Text = ""; txtEmail.Text = ""; txtGender.Text = ""; txtCountry.Text = ""; txtAddress.Text = ""; txtAddress.Text = ""; txtCity.Text = ""; txtState.Text = ""; txtZip.Text = ""; txtMap.Text = ""; txtPosition.Text = ""; txtSalaryGroup.Text = ""; txtWork.Text = ""; txtDepartment.Text = ""; txtProject.Text = ""; txtTaxID.Text = ""; txtBankName.Text = ""; txtAccountNo.Text = ""; txtAccountName.Text = ""; txtRemarks.Text = ""; imgPhoto.Source = null; tabPIC1.IsEnabled = false; tabPIC1.Header = "PIC 1"; txtNamePIC1.Text = ""; txtPhonePIC1.Text = ""; txtEmailPIC1.Text = ""; txtGenderPIC1.Text = ""; txtAddressPIC1.Text = ""; txtCityPIC1.Text = ""; txtStatePIC1.Text = ""; txtZipPIC1.Text = ""; txtMapPIC1.Text = ""; txtPositionPIC1.Text = ""; txtRemarksPIC1.Text = ""; imgPhotoPIC1.Source = null; tabPIC2.IsEnabled = false; tabPIC2.Header = "PIC 2"; txtNamePIC2.Text = ""; txtPhonePIC2.Text = ""; txtEmailPIC2.Text = ""; txtGenderPIC2.Text = ""; txtAddressPIC2.Text = ""; txtCityPIC2.Text = ""; txtStatePIC2.Text = ""; txtZipPIC2.Text = ""; txtMapPIC2.Text = ""; txtPositionPIC2.Text = ""; txtRemarksPIC2.Text = ""; imgPhotoPIC2.Source = null; tabPIC3.IsEnabled = false; tabPIC3.Header = "PIC 3"; txtNamePIC3.Text = ""; txtPhonePIC3.Text = ""; txtEmailPIC3.Text = ""; txtGenderPIC3.Text = ""; txtAddressPIC3.Text = ""; txtCityPIC3.Text = ""; txtStatePIC3.Text = ""; txtZipPIC3.Text = ""; txtMapPIC3.Text = ""; txtPositionPIC3.Text = ""; txtRemarksPIC3.Text = ""; imgPhotoPIC3.Source = null; }