private void btnLogin_Click(object sender, EventArgs e) { if (!helper.PanelControl(pnlLogin)) { MessageBox.Show("Lütfen email adresi ve şifre giriniz"); } else { ul.EmailAdress = txtMailAdress.Text.Trim(); ul.Password = txtPassword.Text.Trim(); if (ulc.UserLogincontrol(ul)) { if (ulc.GetUserLoginEntityControl(ul) == "Müşteri") { userInterface.UserId = ulc.GetUserIdControl(ul); userInterface.Show(); this.Hide(); } else { adminInterFace.AdminId = ulc.GetUserIdControl(ul); adminInterFace.Show(); this.Hide(); } } else { MessageBox.Show("Sistemde kayıtlı değilsiniz lütfen kayıt olun."); } } }
private void btnFinish_Click(object sender, EventArgs e) { int birthdate = dtpckerBirthDate.Value.Year; int today = DateTime.Now.Year; int year = today - birthdate; if (!helper.PanelControl(pnlCustomerRentForm) || txtUserIdentity.TextLength != 11 || year < 18) { MessageBox.Show("Lütfen bilgilerinizi eksiksiz doldurunuz, (18 yaşından küçükler işlem yapamaz.) "); } else { customer.Name = txtUserName.Text.Trim().ToUpper(); customer.LastName = txtUserSurname.Text.Trim().ToUpper(); customer.IdentityNo = txtUserIdentity.Text.Trim(); customer.BirthDate = dtpckerBirthDate.Value; customer.City = txtUserCity.Text.Trim().ToUpper(); if (customerController.AddUserRentDetailController(customer)) { rentedDetail.FirstRentDate = FirstRentDay; rentedDetail.LastRentDate = LastRentDay; rentedDetail.CarId = CarId; rentedDetail.UserId = UserId; rentedDetail.CountOfRentDay = RentDay; rentedDetail.TotalRentPrice = TotalPrice; rentedDetail.CutomerId = customerController.GetCustomerIdController(customer); CarUpdate(); rentedContoller.AddUserDetailContoller(rentedDetail); DialogResult dialogResult = MessageBox.Show("Kiralama işlem başarı ile gerçekleşti tekrar araba kiralamak ister misiniz? ", "Bilgi", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { Carlisting carlisting = new Carlisting(); carlisting.UserId = UserId; carlisting.Show(); this.Close(); } else if (dialogResult == DialogResult.No) { userInterFace.UserId = UserId; userInterFace.Show(); this.Hide(); } } } }
private void btnGoBac_Click(object sender, EventArgs e) { UserInterFace userInterFace = new UserInterFace(); userInterFace.UserId = UserId; userInterFace.Show(); this.Hide(); }