Exemple #1
0
        public ActionResult Post(bool IsNew, Detalle_de_Solicitante_en_ReunionesModel varDetalle_de_Solicitante_en_Reuniones)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (!_tokenManager.GenerateToken())
                    {
                        return(Json(null, JsonRequestBehavior.AllowGet));
                    }
                    _IDetalle_de_Solicitante_en_ReunionesApiConsumer.SetAuthHeader(_tokenManager.Token);



                    var result = "";
                    var Detalle_de_Solicitante_en_ReunionesInfo = new Detalle_de_Solicitante_en_Reuniones
                    {
                        Clave    = varDetalle_de_Solicitante_en_Reuniones.Clave
                        , Nombre = varDetalle_de_Solicitante_en_Reuniones.Nombre
                    };

                    result = !IsNew?
                             _IDetalle_de_Solicitante_en_ReunionesApiConsumer.Update(Detalle_de_Solicitante_en_ReunionesInfo, null, null).Resource.ToString() :
                                 _IDetalle_de_Solicitante_en_ReunionesApiConsumer.Insert(Detalle_de_Solicitante_en_ReunionesInfo, null, null).Resource.ToString();

                    return(Json(result, JsonRequestBehavior.AllowGet));
                }
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException ex)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #2
0
        public ActionResult Create(int Id = 0, int consult = 0)
        {
            int ModuleId   = (Session["CurrentModuleId"] != null) ? Convert.ToInt32(Session["CurrentModuleId"]) : 0;
            var permission = PermissionHelper.GetRoleObjectPermission(SessionHelper.Role, 45103);

            ViewBag.Permission = permission;
            var varDetalle_de_Solicitante_en_Reuniones = new Detalle_de_Solicitante_en_ReunionesModel();

            ViewBag.ObjectId  = "45103";
            ViewBag.Operation = "New";

            ViewBag.IsNew = true;



            if ((Id.GetType() == typeof(string) && Id.ToString() != "") || ((Id.GetType() == typeof(int) || Id.GetType() == typeof(Int16) || Id.GetType() == typeof(Int32) || Id.GetType() == typeof(Int64) || Id.GetType() == typeof(short)) && Id.ToString() != "0"))
            {
                ViewBag.IsNew     = false;
                ViewBag.Operation = "Update";
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _IDetalle_de_Solicitante_en_ReunionesApiConsumer.SetAuthHeader(_tokenManager.Token);
                var Detalle_de_Solicitante_en_ReunionesData = _IDetalle_de_Solicitante_en_ReunionesApiConsumer.GetByKeyComplete(Id).Resource.Detalle_de_Solicitante_en_Reunioness[0];
                if (Detalle_de_Solicitante_en_ReunionesData == null)
                {
                    return(HttpNotFound());
                }

                varDetalle_de_Solicitante_en_Reuniones = new Detalle_de_Solicitante_en_ReunionesModel
                {
                    Clave    = (int)Detalle_de_Solicitante_en_ReunionesData.Clave
                    , Nombre = Detalle_de_Solicitante_en_ReunionesData.Nombre
                    , NombreNombre_Completo = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Solicitante_en_ReunionesData.Nombre), "Detalle_de_Solicitud_Solicitante") ?? (string)Detalle_de_Solicitante_en_ReunionesData.Nombre_Detalle_de_Solicitud_Solicitante.Nombre_Completo
                };
            }
            if (!_tokenManager.GenerateToken())
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }



            ViewBag.Consult = consult == 1;
            if (consult == 1)
            {
                ViewBag.Operation = "Consult";
            }
            return(View(varDetalle_de_Solicitante_en_Reuniones));
        }
Exemple #3
0
        public ActionResult AddDetalle_de_Solicitante_en_Reuniones(int rowIndex = 0, int functionMode = 0, int id = 0)
        {
            int ModuleId = (Session["CurrentModuleId"] != null) ? Convert.ToInt32(Session["CurrentModuleId"]) : 0;

            ViewBag.currentRowIndex = rowIndex;
            ViewBag.functionMode    = functionMode;
            ViewBag.Consult         = false;
            var permission = PermissionHelper.GetRoleObjectPermission(SessionHelper.Role, 45103);

            ViewBag.Permission = permission;
            if (!_tokenManager.GenerateToken())
            {
                return(null);
            }
            _IDetalle_de_Solicitante_en_ReunionesApiConsumer.SetAuthHeader(_tokenManager.Token);
            Detalle_de_Solicitante_en_ReunionesModel varDetalle_de_Solicitante_en_Reuniones = new Detalle_de_Solicitante_en_ReunionesModel();


            if (id.ToString() != "0")
            {
                var Detalle_de_Solicitante_en_ReunionessData = _IDetalle_de_Solicitante_en_ReunionesApiConsumer.ListaSelAll(0, 1000, "Detalle_de_Solicitante_en_Reuniones.Clave=" + id, "").Resource.Detalle_de_Solicitante_en_Reunioness;

                if (Detalle_de_Solicitante_en_ReunionessData != null && Detalle_de_Solicitante_en_ReunionessData.Count > 0)
                {
                    var Detalle_de_Solicitante_en_ReunionesData = Detalle_de_Solicitante_en_ReunionessData.First();
                    varDetalle_de_Solicitante_en_Reuniones = new Detalle_de_Solicitante_en_ReunionesModel
                    {
                        Clave    = Detalle_de_Solicitante_en_ReunionesData.Clave
                        , Nombre = Detalle_de_Solicitante_en_ReunionesData.Nombre
                        , NombreNombre_Completo = CultureHelper.GetTraduction(Convert.ToString(Detalle_de_Solicitante_en_ReunionesData.Nombre), "Detalle_de_Solicitud_Solicitante") ?? (string)Detalle_de_Solicitante_en_ReunionesData.Nombre_Detalle_de_Solicitud_Solicitante.Nombre_Completo
                    };
                }
            }
            if (!_tokenManager.GenerateToken())
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }



            return(PartialView("AddDetalle_de_Solicitante_en_Reuniones", varDetalle_de_Solicitante_en_Reuniones));
        }