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(); } }
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(); } }
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; }
public void RaiseEvent1() { Event1.Raise(this); }
public void RaiseB() { Event1.Raise(this, EventArgs.Empty); }