Ejemplo n.º 1
0
        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!");
            }
        }
Ejemplo n.º 2
0
 private void DeleteAdministration(Administration model)
 {
     try
     {
         getAdministrationBusiness = new AdministrationBusinessLayer();
         getAdministrationBusiness.Delete(model);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message.ToString());
     }
     finally
     {
         txtAdministrationName.Text      = "";
         txtAdministrationPassword.Text  = "";
         btnAdministrationDelete.Enabled = false;
     }
 }
Ejemplo n.º 3
0
        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());
            }
        }
Ejemplo n.º 4
0
        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
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        private void SaveAdministration(Administration model)
        {
            try
            {
                if (_id == 0)
                {
                    getAdministrationBusiness = new AdministrationBusinessLayer();
                    getAdministrationBusiness.Insert(model);
                }
                if (_id > 0)
                {
                    getAdministrationBusiness = new AdministrationBusinessLayer();
                    getAdministrationBusiness.Update(model);
                }

                FillGrid();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }