예제 #1
0
        private void Ekle()
        {
            string message = "";

            if (string.IsNullOrWhiteSpace(txtBrand.Text))
            {
                message += "Marka adı boş geçilemez \n";
            }


            if (message != "")
            {
                MessageBox.Show(message);
                return;
            }
            //dto map
            var dto = new BrandDTO()
            {
                BrandName = txtBrand.Text
            };
            //bll şut
            var result = _bc.AddBrand(dto);

            //gelen cevaba göre mesaj ve işlem.
            result.NotificationShow();

            if (result.State == ResultState.Success)
            {
                txtBrand.Text = "";
                BranAdded.Raise();
            }
        }
예제 #2
0
        private void BtnKaydet_Click(object sender, EventArgs e)
        {
            string message = "";

            if (string.IsNullOrWhiteSpace(txtTcKimlik.Text))
            {
                message += "Kimlik numarası boş geçilemez.\n";
            }
            if (message != "")
            {
                MessageBox.Show(message);
                return;
            }
            //dto map
            var dto = new CustomerDTO()
            {
                FirstName         = txtfirstname.Text,
                LastName          = txtlastname.Text,
                Phone             = txtphone.Text,
                E_mail            = txtmail.Text,
                TcNo              = txtTcKimlik.Text,
                Adress            = txtaddress.Text,
                DriverLicenceType = (DriverLicenceTypeEnum)cmbLicenceType.SelectedItem
            };
            //bll iş katmanı
            var result = _cc.CustomerAdd(dto);

            result.NotificationShow();
            if (result.State == ResultState.Success)
            {
                txtaddress.Text              = "";
                txtfirstname.Text            = "";
                txtlastname.Text             = "";
                txtmail.Text                 = "";
                txtphone.Text                = "";
                txtTcKimlik.Text             = "";
                cmbLicenceType.SelectedIndex = -1;

                CustomerAdded.Raise();
            }
        }
예제 #3
0
        private void BtnGiris_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtName.Text) && string.IsNullOrEmpty(txtPassword.Text))
            {
                MessageBox.Show("Kullanıcı adı ve password boş geçilemez");
                return;
            }
            var kontrol = _sc.UserLogin(txtName.Text, txtPassword.Text);

            if (kontrol != null)
            {
                HashSet <RoleDTO> roles = (HashSet <RoleDTO>)kontrol.Roles;

                lstRoller.DataSource    = roles.ToList();
                lstRoller.DisplayMember = "RoleName";
                lstRoller.ValueMember   = "Id";
                Listele.Raise();
            }
            else
            {
                MessageBox.Show("Kullanıcı adı ve password hatalı");
            }
            Session.CurrentUser = kontrol;
        }
예제 #4
0
 public void RaiseEvent1()
 {
     Event1.Raise(this);
 }
예제 #5
0
 public void RaiseB()
 {
     Event1.Raise(this, EventArgs.Empty);
 }