private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (!isEditingOption) { Branch = new BranchContract(); } }
public BranchAddUC(BranchContract contract) { isEditingOption = true; Branch = contract; #region responses Cities = GetAllCities(); #endregion InitializeComponent(); btnVazgec_Click(new object(), new RoutedEventArgs()); }
private List <BranchContract> FilterEngine(BranchContract _contract) { var connect = new Connector.Banking.Connect <GenericResponse <List <BranchContract> > >(); var request = new BranchRequest(); request.MethodName = "FilterBranchsByProperties"; request.DataContract = _contract; var response = connect.Execute(request); if (!response.IsSuccess) { MessageBox.Show($"{response.ErrorMessage}", "Hata", MessageBoxButton.OK, MessageBoxImage.Error); return(null); } return(response.Value); }
private BranchContract AddBranch(BranchContract _contract) { var connect = new Connector.Banking.Connect <GenericResponse <BranchContract> >(); var request = new BranchRequest(); request.MethodName = "AddNewBranch"; request.DataContract = _contract; var response = connect.Execute(request); if (!response.IsSuccess) { MessageBox.Show($"{response.ErrorMessage}", "Hata", MessageBoxButton.OK, MessageBoxImage.Error); return(null); } return(response.Value); }
public List <BranchContract> GetBranches() { SqlDataReader dr; dr = dbOperation.SpGetData("acc.sel_branches", new SqlParameter[] { }); List <BranchContract> branchContracts = new List <BranchContract>(); BranchContract branchContract; while (dr.Read()) { branchContract = new BranchContract(); branchContract.Id = (int)dr[0]; branchContract.Code = dr[1].ToString(); branchContract.Name = dr[2].ToString(); branchContracts.Add(branchContract); } return(branchContracts); }
private void btnKaydet_Click(object sender, RoutedEventArgs e) { if (isEditingOption) { if (MessageBox.Show("Seçilen şube bilgileri güncellensin mi?", "Uyarı", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) == MessageBoxResult.Yes) { if (UpdateBranch(Branch) != null) { MessageBox.Show("Şube güncellenmiştir", "Başarılı", MessageBoxButton.OK, MessageBoxImage.Information); btnVazgec_Click(new object(), new RoutedEventArgs()); } } return; } if (MessageBox.Show("Bilgilerini girdiğiniz şube kaydedilsin mi?", "Onay", MessageBoxButton.YesNoCancel, MessageBoxImage.Question) == MessageBoxResult.Yes) { if (AddBranch(Branch) != null) { MessageBox.Show($"Şube eklendi!", "Başarılı", MessageBoxButton.OK, MessageBoxImage.Information); Branch = new BranchContract(); } } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { FilterContract = new BranchContract(); }
private void btnTemizle_Click(object sender, RoutedEventArgs e) { FilterContract = new BranchContract(); }