Пример #1
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     if (!isEditingOption)
     {
         Branch = new BranchContract();
     }
 }
Пример #2
0
        public BranchAddUC(BranchContract contract)
        {
            isEditingOption = true;
            Branch          = contract;

            #region responses
            Cities = GetAllCities();
            #endregion

            InitializeComponent();
            btnVazgec_Click(new object(), new RoutedEventArgs());
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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();
                }
            }
        }
Пример #7
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     FilterContract = new BranchContract();
 }
Пример #8
0
 private void btnTemizle_Click(object sender, RoutedEventArgs e)
 {
     FilterContract = new BranchContract();
 }