public JsonResult GetExecutiveChilds(int level)
        {
            var usr = (Login)System.Web.HttpContext.Current.Session["usr"];

            if (usr == null)
            {
                RedirectToAction("Index", "Home");
                return(null);
            }
            var childs = new ManageExecutive().GetExecutiveChilds(usr.userName, level);

            return(new JsonResult {
                Data = childs, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        public JsonResult GetExecutiveInformation()
        {
            var usr = (Login)System.Web.HttpContext.Current.Session["usr"];
            if (usr == null)
            {
                RedirectToAction("Index", "Home");
                return null;
            }
            string executiveID = String.Empty;

            if (usr != null)
                executiveID = usr.userName;

            var dataExecutive = new ManageExecutive().GetExecutiveInformation(executiveID, usr.asesor);
            return new JsonResult { Data = dataExecutive, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
        }
        public JsonResult UpdateExcecutive(InUpdateExecutiveService formulario, List<HttpPostedFile> files)
        {
            var usr = (Login)System.Web.HttpContext.Current.Session["usr"];
            if (usr == null)
            {
                RedirectToAction("Index", "Home");
                return null;
            }
            InUpdateExecutive infoExecutive = new InUpdateExecutive();
            var response = new Response();

            var valid = new ManageExecutive().MapEntity(formulario, infoExecutive, ref response);
            if (valid)
            {
                response = new ManageExecutive().UpdateExecutive(infoExecutive);
            }

            return new JsonResult { Data = response, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
        }