Beispiel #1
0
        private void btnDeleteMail_Click(object sender, RoutedEventArgs e)
        {
            if (dgCustomerMail.SelectedItem == null)
            {
                MessageBox.Show("Lütfen Gridden silinecek Mail adresini seçiniz."); return;
            }

            CustomerMailContract customerMail = new CustomerMailContract();

            customerMail = dgCustomerMail.SelectedItem as CustomerMailContract;

            var connect = new Connector.Banking.GenericConnect <CustomerMailResponse>();
            var request = new Types.Banking.CustomerMailRequest();

            request.customerMail = customerMail;
            request.MethodName   = "DelCustomerMail";

            var response = connect.Execute(request);

            if (response.IsSuccess == true)
            {
                MessageBox.Show("Mail adres silme işlemi başarı ile gerçekleştirildi.");
                this.Close();
                return;
            }
            else
            {
                MessageBox.Show("Mail adres silme işlemi başarısız oldu.");
                return;
            }
        }
        public List <CustomerMailContract> UpdCustomerMail(CustomerMailContract customerMail)
        {
            SqlDataReader dr;

            dr = dbOperation.SpGetData("cus.upd_customermail", new SqlParameter[] {
                new SqlParameter("@Id", customerMail.Id),
                new SqlParameter("@MailAddress", customerMail.MailAddress),
                new SqlParameter("@CustomerId", customerMail.CustomerId)
            });

            List <CustomerMailContract> customerMails = new List <CustomerMailContract>();
            CustomerMailContract        customerAddressTemp;

            while (dr.Read())
            {
                customerAddressTemp             = new CustomerMailContract();
                customerAddressTemp.Id          = (int)dr[0];
                customerAddressTemp.MailAddress = dr[1].ToString();
                customerAddressTemp.CustomerId  = (int)dr[2];


                customerMails.Add(customerAddressTemp);
            }

            return(customerMails);
        }
Beispiel #3
0
        private void GetCustomerMail(CustomerMailContract customerMail)
        {
            customerMails = new List <CustomerMailContract>();
            var connect = new Connector.Banking.GenericConnect <CustomerMailResponse>();
            var request = new Types.Banking.CustomerMailRequest();

            request.customerMail = customerMail;
            request.MethodName   = "GetCustomerMail";

            var response = connect.Execute(request);

            if (response.IsSuccess == true)
            {
                foreach (var item in response.customerMails)
                {
                    customerMails.Add(item);
                }
                dgCustomerMail.ItemsSource = response.customerMails;
                dgCustomerMail.Items.Refresh();
                return;
            }
            else
            {
                return;
            }
        }
Beispiel #4
0
        //----------------------------------------------------------------------



        //Mail CRUD butonları
        private void btnAddMail_Click(object sender, RoutedEventArgs e)
        {
            CustomerMailContract customerMail = new CustomerMailContract();

            customerMail.CustomerId = customerDetail.Id;
            CustomerMailWindow.MainWindow addMailWindow = new CustomerMailWindow.MainWindow(customerMail);
            addMailWindow.Show();
        }
        public MainWindow(CustomerMailContract customerMail)
        {
            _customerMail = customerMail;
            InitializeComponent();

            if (_customerMail.Id > 0)
            {
                txtMailId.Text      = _customerMail.Id.ToString();
                txtMailAddress.Text = _customerMail.MailAddress;
            }
        }
Beispiel #6
0
        private void btnUpdateMail_Click(object sender, RoutedEventArgs e)
        {
            CustomerMailContract customerMail = new CustomerMailContract();

            customerMail.CustomerId = customerDetail.Id;
            if (dgCustomerMail.SelectedItem == null)
            {
                MessageBox.Show("Lütfen Gridden güncellenecek Mail adresini seçiniz."); return;
            }
            customerMail = dgCustomerMail.SelectedItem as CustomerMailContract;
            CustomerMailWindow.MainWindow addMailWindow = new CustomerMailWindow.MainWindow(customerMail);
            addMailWindow.Show();
        }
        public List <CustomerMailContract> GetCustomerMail(int Id)
        {
            SqlDataReader dr;

            dr = dbOperation.SpGetData("cus.sel_customermails", new SqlParameter[] {
                new SqlParameter("@Id", Id)
            });

            List <CustomerMailContract> customerMails = new List <CustomerMailContract>();
            CustomerMailContract        customerMail;

            while (dr.Read())
            {
                customerMail             = new CustomerMailContract();
                customerMail.Id          = (int)dr[0];
                customerMail.MailAddress = dr[1].ToString();
                customerMail.CustomerId  = (int)dr[2];
                customerMails.Add(customerMail);
            }

            return(customerMails);
        }