public ResponseGeneric <EmployeeET> GetEmployee(EmployeeET model)
        {
            try
            {
                IEnumerable <EmployeeET> res = null;

                Dictionary <string, string> parameters = new Dictionary <string, string>();

                parameters.Add("@parametro1", model.Id.ToString());

                parameters.Add("@parametro2", model.Email.CleanParameter());

                string query = $@"SELECT Name,LastName FROM Employee WITH(NOLOCK) WHERE Id = '{model.Id}' ";

                //res = Extensions.Utils.Execute_Query<EmployeeET>(query, this._configuration["ConnectionStrings:CRM"]);

                //return new ResponseGeneric<EmployeeET>(res.First());

                EmployeeET employee = new EmployeeET()
                {
                    Id       = 1,
                    Country  = "CR",
                    Email    = "*****@*****.**",
                    LastName = "lastname",
                    Name     = "Maria"
                };

                return(new ResponseGeneric <EmployeeET>(employee));
            }

            catch (Exception ex)
            {
                return(new ResponseGeneric <EmployeeET>(new Exception($"{System.Reflection.MethodBase.GetCurrentMethod().Name} - JsonInput: {JsonConvert.SerializeObject(model)}", ex)));
            }
        }
        public ResponseGeneric <EmployeeET> GetEmployee(EmployeeET model)
        {
            //logica negocio
            //paso1
            //paso2

            return(this._employeDA.GetEmployee(model));
        }
        public ResponseGeneric <IEnumerable <EmployeeET> > GetEmployees(EmployeeET model)
        {
            //logica negocio
            //paso1
            //paso2

            return(this._employeDA.GetEmployees(model));
        }
 public IActionResult ListdoEmployee(EmployeeET model)
 {
     try
     {
         return(Json(_shared.EjecutarServicio <ResponseGeneric <IEnumerable <EmployeeET> > >(JsonConvert.SerializeObject(model), "Employee/GetEmployees")));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message));
     }
 }
        public ResponseGeneric <EmployeeET> UpsertEmployee(EmployeeET model)
        {
            try
            {
                IEnumerable <EmployeeET> res = null;

                Dictionary <string, string> parameters = new Dictionary <string, string>();

                parameters.Add("@parametro1", model.Id.ToString());

                parameters.Add("@parametro2", model.Email.CleanParameter());

                res = Utils.Execute_Query <EmployeeET>("[dbo].[ect_Upsert_Employee]", parameters, this._configuration["ConnectionStrings:CRM"]);

                return(new ResponseGeneric <EmployeeET>(res.First()));
            }
            catch (Exception ex)
            {
                return(new ResponseGeneric <EmployeeET>(new Exception($"{System.Reflection.MethodBase.GetCurrentMethod().Name} - JsonInput: {JsonConvert.SerializeObject(model)}", ex)));
            }
        }
        public ResponseGeneric <IEnumerable <EmployeeET> > GetEmployees(EmployeeET model)
        {
            try
            {
                IEnumerable <EmployeeET> res = null;

                Dictionary <string, string> parameters = new Dictionary <string, string>();

                parameters.Add("@parametro1", model.Id.ToString());

                parameters.Add("@parametro2", model.Email.CleanParameter());

                res = Utils.Execute_Query <EmployeeET>("[dbo].[ect_Upsert_Employee]", parameters, this._configuration["ConnectionStrings:CRM"]);

                return(new ResponseGeneric <IEnumerable <EmployeeET> >(res));

                //List<EmployeeET> list_employee = new List<EmployeeET>();

                //for (int i = 0; i < 15; i++)
                //{
                //    EmployeeET employee = new EmployeeET()
                //    {
                //        Id = i,
                //        Country = "CR",
                //        Email = "*****@*****.**",
                //        LastName = "lastname",
                //        Name = "Maria"
                //    };

                //    list_employee.Add(employee);
                //}

                //return new ResponseGeneric<IEnumerable<EmployeeET>>(list_employee.ToList());
            }
            catch (Exception ex)
            {
                return(new ResponseGeneric <IEnumerable <EmployeeET> >(new Exception($"{System.Reflection.MethodBase.GetCurrentMethod().Name} - JsonInput: {JsonConvert.SerializeObject(model)}", ex)));
            }
        }
 public ResponseGeneric <EmployeeET> GetEmployee([FromBody] EmployeeET model)
 {
     return(this._employeeBL.GetEmployee(model));
 }
 public ResponseGeneric <IEnumerable <EmployeeET> > GetEmployees([FromBody] EmployeeET model)
 {
     return(this._employeeBL.GetEmployees(model));
 }