Esempio n. 1
0
        /// <summary>
        /// Validate Login
        /// </summary>
        private void comprobarLogin()
        {
            PersonBusinessLogic LoginBL = new PersonBusinessLogic();

            //Get search criteria
            string IDintroduced = textBoxIdUsu.Text;
            int    id;


            if (int.TryParse(IDintroduced, out id))
            {
                if (LoginBL.PersonExist(id))
                {
                }
                else
                {
                    base.ShowMessage("El usuario no existe");

                    // data clear and focus on id
                    textBoxIdUsu.Clear();
                    textBoxIdUsu.Focus();
                    textBoxPassword.Clear();
                }
            }
            else
            {
                base.ShowMessage("Tiene que introducir un numero");

                // data clear and focus on id
                textBoxIdUsu.Clear();
                textBoxIdUsu.Focus();
                textBoxPassword.Clear();
            }
        }
 //public constructor with DI using asp.net core DI services
 public PersonDataController(IRepository <PersonBase> ObjectOfPersonRepository, IRepository <ProjectPersonBase> ObjectOfProjectPersonRepository, EUow ObjectOfUnitOfWork)
 {
     //set unit of work with connection string to connect to database
     _ObjectUnitOfWork = ObjectOfUnitOfWork;
     ObjectOfPersonRepository.SetUnitWork(_ObjectUnitOfWork);
     ObjectOfProjectPersonRepository.SetUnitWork(_ObjectUnitOfWork);
     _objectOfPersonRepository           = ObjectOfPersonRepository;
     _objectOfProjectPersonRepository    = ObjectOfProjectPersonRepository;
     _ObjectOfPersonBusinessLogic        = new PersonBusinessLogic(_objectOfPersonRepository);
     _ObjectOfProjectPersonBusinessLogic = new ProjectPersonBusinessLogic(_objectOfProjectPersonRepository);
 }
Esempio n. 3
0
        /// <summary>
        /// Set header info of customer
        /// </summary>
        private void SetPersonData()
        {
            try
            {
                PersonBusinessLogic personBL = new PersonBusinessLogic();

                Customer personDetails = personBL.getCustomerInfo(custumerId);

                // Set header info
                textBoxName.Text   = personDetails.FirstName;
                textBoxStore.Text  = personDetails.Store;
                texBTerritory.Text = personDetails.Territory;
            }
            catch //(Exception ex)
            {
                throw;
            }
        }