示例#1
0
        public ActionResult GetWhitePagesDetails(string cai)
        {
            com.chevron.ctpeople.getpeople ws = new TSDTReports.com.chevron.ctpeople.getpeople();
            List <string> subList             = new List <string>();

            try
            {
                var test     = ws.dsGetPersonByCAI(cai).Tables[0].Rows[0];
                var jsondata = new
                {
                    WhitePagesDetails =
                        (
                            new
                    {
                        firstname = test.ItemArray[6],
                        surname = test.ItemArray[8]
                    }
                        )
                };
                return(Json(jsondata));
            }
            catch
            {
                return(Json(new { Status = false, Message = "Fail" }));
            }
        }
示例#2
0
        public ActionResult GetUserEmployees(string cai)
        {
            string Surname = "";

            try
            {
                com.chevron.ctpeople.getpeople ws = new TSDTReports.com.chevron.ctpeople.getpeople();
                var test = ws.dsGetPersonByCAI(cai).Tables[0].Rows[0];
                Surname = test.ItemArray[8].ToString();
            }
            catch
            {
                return(Json(new { Status = false, Message = "This user does not exist in WhitePages" }));
            }
            try
            {
                var jsondata = new
                {
                    employees =
                        (
                            from e in sacodb.EmployeeList(Surname.Trim())
                            select new
                    {
                        employee_number = e.EmployeeNumber,
                        employee_surname = e.Surname,
                        employee_firstname = e.FirstName,
                        employee_company = e.Company.Name,
                        employee_companyid = e.CompanyId
                    }
                        )
                };
                return(Json(jsondata));
            }
            catch (Exception ex)
            {
                return(Json(new { Status = false, Message = "This user does not exist in Saco" }));
            }
        }
示例#3
0
        public ActionResult GetWhitePagesDetails(string cai)
        {
            com.chevron.ctpeople.getpeople ws = new TSDTReports.com.chevron.ctpeople.getpeople();
            List<string> subList = new List<string>();
            try
            {
                var test = ws.dsGetPersonByCAI(cai).Tables[0].Rows[0];
                var jsondata = new
                {
                    WhitePagesDetails =
                    (
                        new
                        {
                           firstname = test.ItemArray[6],
                           surname = test.ItemArray[8]
                        }
                    )
                };
                return Json(jsondata);

            }
            catch
            {
                return Json(new { Status = false, Message = "Fail" });
            }
        }
示例#4
0
 public ActionResult GetUserEmployees(string cai)
 {
     string Surname = "";
     try
     {
         com.chevron.ctpeople.getpeople ws = new TSDTReports.com.chevron.ctpeople.getpeople();
         var test = ws.dsGetPersonByCAI(cai).Tables[0].Rows[0];
         Surname = test.ItemArray[8].ToString();
     }
     catch
     {
         return Json(new { Status = false, Message = "This user does not exist in WhitePages" });
     }
     try
     {
         var jsondata = new
         {
             employees =
             (
                 from e in sacodb.EmployeeList(Surname.Trim())
                 select new
                 {
                     employee_number = e.EmployeeNumber,
                     employee_surname = e.Surname,
                     employee_firstname =  e.FirstName,
                     employee_company = e.Company.Name,
                     employee_companyid = e.CompanyId
                 }
             )
         };
         return Json(jsondata);
     }
     catch (Exception ex)
     {
         return Json(new { Status = false, Message = "This user does not exist in Saco" });
     }
 }