Exemple #1
0
        public JsonResult GetEmployeeForRegister()
        {
            try
            {
                List <ExecutiveViewModel> Result = new List <ExecutiveViewModel>();
                {
                    var ResultList = sPService.GetEmployeeForRegister();

                    Result = ResultList.Tables[0].AsEnumerable()
                             .Select(row => new ExecutiveViewModel
                    {
                        UserId       = row.Field <int>("UserId"),
                        EmployeeName = row.Field <string>("EmployeeName"),
                        EmployeeCode = row.Field <string>("EmployeeCode"),
                        Email        = row.Field <string>("Email")
                    }).ToList();
                }
                return(Json(Result, JsonRequestBehavior.AllowGet));
            }

            catch (Exception ex)
            {
                return(Json(new { Result = "ERROR", Message = ex.Message }, JsonRequestBehavior.AllowGet));
            }
        }