private void Login(string _username, string _password) { getBusiness = new AdministrationBusinessLayer(); var userList = getBusiness.GetAll(); bool alert = false; foreach (var item in userList) { if (item.Username == _username && item.Password == _password) { alert = true; } } if (alert) { CustomerListForm openCustomer = new CustomerListForm(); openCustomer.Show(); this.Hide(); } if (!alert) { MessageBox.Show("Hatalı Veri Bilgilerinizi Kontrol Ediniz!"); } }
private void SaveAdministration(Administration model) { try { getBusiness = new AdministrationBusinessLayer(); var list = getBusiness.GetAll(); int counter = list.Count(); if (counter < 1) { getBusiness = new AdministrationBusinessLayer(); getBusiness.Insert(model); } } catch (Exception ex) { throw new Exception(ex.Message.ToString()); } }
void FillGrid() { #region Fill Customer List getBusiness = new CustomerBusinessLayer(); var list = getBusiness.GetAll(); List <Customer> passPaymentDateList = new List <Customer>(); List <Customer> _CustomerGridList = new List <Customer>(); foreach (var item in list) { if (item.PassPaymentDate < DateTime.Now) { passPaymentDateList.Add(item); } if (item.PassPaymentDate > DateTime.Now) { _CustomerGridList.Add(item); } } lblActiveCustomer.Text = list.Count().ToString(); lblPaymentCustomer.Text = _CustomerGridList.Count().ToString(); lblPassPaymentCustomer.Text = passPaymentDateList.Count().ToString(); #endregion #region FillDevCustomerGrid grdPaymentPassDate.DataSource = passPaymentDateList; grdAllCustomers.DataSource = _CustomerGridList; //grdPassPayDateMain.DataSource = passPaymentDateList; #endregion #region Fill Administration List getAdministrationBusiness = new AdministrationBusinessLayer(); var adminList = getAdministrationBusiness.GetAll(); grdAdministration.DataSource = adminList; #endregion }
private bool Login(string _username, string _password) { getAdministrationBusiness = new AdministrationBusinessLayer(); var userList = getAdministrationBusiness.GetAll(); bool alert = false; foreach (var item in userList) { if (item.Username == _username && item.Password == _password) { alert = true; } } if (!alert) { MessageBox.Show("Hatalı Veri Bilgilerinizi Kontrol Ediniz!"); } return(alert); }