public ActionResult UpdateEmployee(EmployeeModel EmployeeData, int IdEmployee)
        {
            try
            {
                CRUDEmployee = new EmployeeRepository();
                CRUDEmployee.UpdateEmployee(EmployeeData);

            return RedirectToAction("SearchEmployee", "Employee");
            }
            catch
            {

            return View();
            }
        }
        public int UpdateEmployee(EmployeeModel EmployeeData)
        {
            int Result = -1;

            using (ConnectionSQL = new SqlConnection(ConnectionDB))
            {
                using (CmdSQL = new SqlCommand("UpdateEmployee", ConnectionSQL))
                {
                    CmdSQL.CommandType = CommandType.StoredProcedure;
                    CmdSQL.Parameters.Add("@IdEmployee", SqlDbType.Int).Value = EmployeeData.IdEmployee;
                    CmdSQL.Parameters.Add("@Username", SqlDbType.NVarChar, 20).Value = EmployeeData.Username;
                    CmdSQL.Parameters.Add("@UserPassword", SqlDbType.NVarChar, 20).Value = EmployeeData.UserPassword;
                    CmdSQL.Parameters.Add("@EmailAddress", SqlDbType.NVarChar, 100).Value = EmployeeData.EmailAddress;
                    CmdSQL.Connection.Open();

                    Result = CmdSQL.ExecuteNonQuery();
                }
            }

        return Result;
        }
        public ActionResult RegisterEmployee(EmployeeModel EmployeeData)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    CRUDEmployee = new EmployeeRepository();

                    if(CRUDEmployee.RegisterEmployee(EmployeeData) >= 1)
                    {
                        ViewBag.Message = "Empleado registrado";
                        ModelState.Clear();
                    }
                }

            return View();
            }
            catch
            {

            return View();
            }
        }
        public List<EmployeeModel> SearchEmployee()
        {
            List<EmployeeModel> Employees = new List<EmployeeModel>();

            using (ConnectionSQL = new SqlConnection(ConnectionDB))
            {
                using (CmdSQL = new SqlCommand("SearchEmployee", ConnectionSQL))
                {
                    CmdSQL.CommandType = CommandType.StoredProcedure;
                    CmdSQL.Connection.Open();
                    AdapterSQL = new SqlDataAdapter(CmdSQL);
                    TablesSQL = new DataTable();
                    AdapterSQL.Fill(TablesSQL);

                    ReaderSQL = CmdSQL.ExecuteReader();

                    while (ReaderSQL.Read())
                    {
                        EmployeeModel EmployeeData = new EmployeeModel
                        {
                            IdEmployee = (int)ReaderSQL["Id Employee"],
                            Username = ReaderSQL["Username"].ToString(),
                            UserPassword = ReaderSQL["User Password"].ToString(),
                            EmployeeName = ReaderSQL["Employee Name"].ToString(),
                            EmployeeFamilyName = ReaderSQL["Employee Family Name"].ToString(),
                            DateOfBirth = (DateTime)ReaderSQL["Date Of Birth"],
                            Age = (int)ReaderSQL["Age"],
                            EmailAddress = ReaderSQL["Email Address"].ToString()
                        };

                    Employees.Add(EmployeeData);
                    }
                }
            }

        return Employees;
        }