Beispiel #1
0
        /// <summary>
        /// Devuelve todos los elementos del menu para el control combo-box
        /// </summary>
        /// <returns>Json CustomJSON</returns>
        public ActionResult UVdTdmlD()
        {
            CustomJSON            globalResponse = new CustomJSON();
            List <SelectListItem> Items          = new List <SelectListItem>();

            if (User != null)
            {
                try
                {
                    Items.Add(new SelectListItem {
                        Text = "Ninguno", Value = "0"
                    });
                    Items.AddRange(new BLMenu().Listar().Select(p => new SelectListItem {
                        Text = add_dash(p.Nombre, p.Nivel), Value = p.Id.ToString()
                    }).ToList());

                    globalResponse.DATA = Items;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public ActionResult hSm2WfIC()
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var Monedas = new BLMoneda().Listar()
                                  .Select(p => new SelectListItem {
                        Value = p.CID, Text = p.ISO4217 + " - " + p.Nombre
                    })
                                  .OrderBy(q => q.Text)
                                  .ToList();

                    globalResponse.DATA = Monedas;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public ActionResult Tk1hVEVk(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();
            string     _err           = string.Empty;

            if (User != null)
            {
                try
                {
                    var         idp       = Peach.DecriptText(sid);
                    BEParametro parametro = new BEParametro();
                    parametro.Id = Convert.ToInt16(idp);

                    globalResponse.DATA = new BLParametro().ListarDetalle(parametro);
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }

            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
        public ActionResult TU1sdEZJ(string sid)
        {
            /*
             * Obs:    Se convierte en IEnumerable<SelectListItem> para factorizar las funciones javascript "fillxxx "
             *      en documento que lo invoca
             */
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int id = Convert.ToInt16(Peach.DecriptText(sid));
                        IEnumerable <SelectListItem> monedas = new BLMoneda().Listar_Select_byOSE(id)
                                                               .Select(p => new SelectListItem {
                            Text = p.Nombre, Value = p.CID
                        });

                        globalResponse.DATA = monedas;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #5
0
        public ActionResult OUlSU3Ez(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();

            if (User != null)
            {
                try
                {
                    var id = Peach.DecriptText(sid);

                    BEParametro parametro = new BEParametro();
                    parametro.Id      = 0;
                    parametro.Detalle = new BEParametroItem
                    {
                        Id = Convert.ToInt16(id)
                    };

                    BEParametroItem detalle = new BLParametro().ListarDetalle_byId(parametro);
                    globalResponse.DATA = detalle;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
                return(Json(globalResponse, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
        }
Beispiel #6
0
        /// <summary>
        /// Devuelve los datos de una opcion de menu en base a su id
        /// </summary>
        /// <param name="id">Id de la opcion</param>
        /// <returns>Json result</returns>
        public ActionResult SFpocmJ3(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();
            BEMenuItem Item           = new BEMenuItem();

            string _err = string.Empty;

            if (User != null)
            {
                try
                {
                    Item = new BLMenu().Listar_byId(Convert.ToInt16(sid));
                    globalResponse.DATA = Item;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #7
0
        public ActionResult Tk5obGw4(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int i_sid    = Convert.ToInt16(Peach.DecriptText(sid));
                        var Regiones = new BLPais().Listar_Regiones_byContinente(i_sid)
                                       .Select(p => new SelectListItem {
                            Value = p.CID, Text = p.Nombre
                        }).ToList();

                        globalResponse.DATA = Regiones;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #8
0
        public ActionResult TjQxYWpE(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();
            BEPais     Pais           = new BEPais();

            string _err = string.Empty;

            if (User != null)
            {
                try
                {
                    string Id = Peach.DecriptText(sid);

                    Pais = new BLPais().Listar_byId(Convert.ToInt16(Id));
                    globalResponse.DATA = Pais;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #9
0
        public ActionResult YVVFN2hr(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();
            string     _err           = string.Empty;

            if (User != null)
            {
                try
                {
                    if (sid != string.Empty)
                    {
                        int id = Convert.ToInt16(Peach.DecriptFromBase64(sid));
                        globalResponse.DATA = new BLBanco().ListarAgencias(id);
                    }
                    else
                    {
                        globalResponse.DATA = null;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }

            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #10
0
        public ActionResult TU1sdEZJ(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int id = Convert.ToInt16(Peach.DecriptText(sid));
                        var AgenciaBancaria = new BLBanco().ListarAgencia(id);
                        globalResponse.DATA = AgenciaBancaria;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #11
0
        public ActionResult OvEIqYav(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int id = Convert.ToInt16(Peach.DecriptText(sid));
                        IEnumerable <SelectListItem> personas = new BLPersonalLocal().Listar_Directivo_toSelect_byOse(id)
                                                                .Select(q => new SelectListItem {
                            Text = q.Apellidos, Value = q.CID
                        });

                        globalResponse.DATA = personas;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #12
0
        public ActionResult NVdqVjlt(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        int id = Convert.ToInt16(Peach.DecriptText(sid));
                        IEnumerable <SelectListItem> agencias = new BLBanco().ListarAgencia_ToSelect_ByOse(id)
                                                                .Select(p => new SelectListItem {
                            Text = p.Nombre, Value = p.CID
                        });

                        globalResponse.DATA = agencias;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #13
0
        /// <summary>
        /// Devuelve los datos de un usuario especificado por su id
        /// </summary>
        /// <param name="sid">id sha1 del usuario</param>
        /// <returns></returns>
        public ActionResult V0I0MmZV(string sid)
        {
            CustomJSON globalResponse = new CustomJSON();
            BEUsuario  Usuario        = new BEUsuario();

            string _err = string.Empty;

            if (User != null)
            {
                try
                {
                    string Id = Peach.DecriptFromBase64(sid);

                    Usuario             = new BLUsuario().Listar_byId(Convert.ToInt16(Id));
                    globalResponse.DATA = Usuario;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #14
0
        public ActionResult Y2ZTaUlU(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var nom = model[0].Trim().ToUpper();
                    var grp = model[1];
                    var des = model[2].Trim().ToUpper();
                    var sid = model[3].Trim();

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre para el parámetro.";
                    }
                    else if (grp == null)
                    {
                        globalResponse.ERR = "No ha seleccionado un grupo para el parámetro.";
                    }
                    else
                    {
                        BEParametro parametro = new BEParametro
                        {
                            Id     = (sid != string.Empty) ? Convert.ToInt16(Peach.DecriptText(sid)) : 0,
                            Nombre = nom,
                            Grupo  = new BEParametroGrupo
                            {
                                Id = Convert.ToInt16(Peach.DecriptText(grp))
                            },
                            Descripcion = des,
                            RowAudit    = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };
                        oResponse           = new BLParametro().Grabar(parametro);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #15
0
        public static XCCustomJSONNotification GetCommonType(CustomJSON CustomJSONNotification)
        {
            XCCustomJSONNotification XCustomJSON = new XCCustomJSONNotification();

            XCustomJSON.NotificationMessage = CustomJSONNotification.NotificationMessage;

            XCustomJSON.Content = From((Android.Runtime.JavaDictionary)CustomJSONNotification.Content);

            XCustomJSON.Id = CustomJSONNotification.Id;

            return(XCustomJSON);
        }
Beispiel #16
0
            public void GotCustomJSONNotification(CustomJSON p0, TrackingInfo p1)
            {
                XCCustomJSONNotification XCustomJSON = AdapterCustom.GetCommonType(p0);

                if (NearPCL.GetContentManager() != null)
                {
                    NearPCL.GetContentManager().GotXCustomJSONNotification(XCustomJSON);
                }
                else
                {
                    Console.WriteLine("You receive a content but you haven't registered a content manager");
                }
            }
Beispiel #17
0
        public ActionResult enNBUT09(List <string> dat)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var nom = dat[0].Trim().ToUpper();
                    var url = dat[1].Trim().ToUpper();
                    var sit = dat[2];
                    var sid = dat[3];

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre para el banco";
                    }
                    else
                    {
                        BEBanco Banco = new BEBanco
                        {
                            Id        = (sid != "") ? Convert.ToInt16(Peach.DecriptFromBase64(sid)) : 0,
                            Nombre    = nom,
                            Url       = url,
                            Situacion = new ItemGenerico {
                                IntValue = Convert.ToByte(sit)
                            },

                            RowAudit = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };

                        oResponse           = new BLBanco().Grabar(Banco);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #18
0
        public void FromNativeToBridgeCustomJSON()
        {
            CustomJSON     customJSON = new CustomJSON();
            JavaDictionary jsonMap    = new JavaDictionary();

            jsonMap.Add("nome", "stefano");
            jsonMap.Add("numero", 4.6);
            Java.Util.ArrayList lista = new Java.Util.ArrayList();
            lista.Add(3.0);
            lista.Add(4.0);
            jsonMap.Add("lista", lista);

            JavaDictionary innerDict = new JavaDictionary();

            innerDict.Add("nome", "martin");
            innerDict.Add("cognome", "scorsese");
            jsonMap.Add("inner_object", innerDict);

            customJSON.Content             = jsonMap;
            customJSON.NotificationMessage = "messaggio";

            XCCustomJSONNotification jSONNotification = AdapterCustom.GetCommonType(customJSON);

            Assert.True(jSONNotification.Content is Dictionary <string, object>);

            jSONNotification.Content.TryGetValue("nome", out object stringValue);
            Assert.True(stringValue is string);
            Assert.True(stringValue.Equals("stefano"));

            jSONNotification.Content.TryGetValue("numero", out object doubleValue);
            Assert.True(doubleValue is double);
            Assert.True(doubleValue.Equals(4.6));

            jSONNotification.Content.TryGetValue("lista", out object listValue);
            Assert.True(listValue is List <object>);
            Assert.True((listValue as List <object>)[0] is double);
            Assert.True((double)(listValue as List <object>)[0] == 3.0);
            Assert.True((listValue as List <object>)[1] is double);
            Assert.True((double)(listValue as List <object>)[1] == 4.0);

            jSONNotification.Content.TryGetValue("inner_object", out object innerObj);
            Assert.True(innerObj is Dictionary <string, object>);
            Dictionary <string, object> castedDic = innerObj as Dictionary <string, object>;

            castedDic.TryGetValue("nome", out object name);
            Assert.True(name is string);
            Assert.True(((string)name).Equals("martin"));
            castedDic.TryGetValue("cognome", out object cognome);
            Assert.True(cognome is string);
            Assert.True(((string)cognome).Equals("scorsese"));
        }
Beispiel #19
0
        // Tree de Perfiles

        /// <summary>
        /// Devuelve todas las opciones del menu, con las opciones del perfil seleccionado
        /// </summary>
        /// <param name="sid">Id del perfil</param>
        /// <returns></returns>
        public ActionResult XVxJ3pT0(string sid)
        {
            CustomJSON         globalResponse = new CustomJSON();
            ResponserData      oResponse      = new ResponserData();
            List <BEMenuItem>  Items          = new List <BEMenuItem>();
            List <JsTreeModel> jsTree         = new List <JsTreeModel>();

            string _err = string.Empty;

            if (User != null)
            {
                try
                {
                    var id = Peach.DecriptText(sid);
                    Items = new BLMenu().ListarInterfaz(Convert.ToInt16(id)).ToList();

                    foreach (BEMenuItem menu in Items)
                    {
                        jsTree.Add(new JsTreeModel
                        {
                            id     = menu.Id.ToString(),
                            parent = (menu.Padre.IntValue == 0) ? "#" : menu.Padre.IntValue.ToString(),
                            text   = menu.Nombre,
                            data   = new JsTreeModel_data
                            {
                                idp = (menu.Padre.IntValue == 0) ? "#" : menu.Padre.IntValue.ToString(),
                                nop = menu.Padre.Texto,
                            },
                            state = new JsTreeModelState
                            {
                                opened   = true,
                                selected = (menu.IsAuth.IntValue == 1)
                            }
                        });
                    }
                    globalResponse.DATA = jsTree;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(jsTree, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// Devuelve las Jefaturas de Servicio (Consulados)
        /// </summary>
        /// <param name="sid">Código de País</param>
        /// <returns></returns>
        public ActionResult dklHc0hk(string sid)
        {
            /*
             * Nota:
             * - Sólo los consulados son considerados Jefaturas de Servicios
             */

            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    if (sid != null)
                    {
                        string s_sid = (sid != "0") ? Peach.DecriptFromBase64(sid) : "0";
                        int    i_sid = Convert.ToInt16(s_sid);

                        // Jefatura de Servicio
                        List <SelectListItem> Items = new List <SelectListItem>();
                        Items.Add(new SelectListItem {
                            Text = "- NINGUNO -", Value = Peach.EncriptText("0")
                        });
                        Items.AddRange(
                            new BLOrganoServicio().Listar_byTipoPais_ToSelect(OrganosServicioType.Consulado, i_sid)
                            .Select(p => new SelectListItem {
                            Text = p.Abreviatura, Value = p.CID
                        })
                            .ToList());

                        globalResponse.DATA = Items;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #21
0
        /// <summary>
        /// Devuelve los items del menu para el control TreeView
        /// </summary>
        /// <returns></returns>
        public ActionResult YjFJRVFs()
        {
            CustomJSON         globalResponse = new CustomJSON();
            List <BEMenuItem>  MenuItems      = new List <BEMenuItem>();
            List <JsTreeModel> jsTree         = new List <JsTreeModel>();

            string _err = string.Empty;

            if (User != null)
            {
                try
                {
                    MenuItems = new BLMenu().Listar();
                    foreach (BEMenuItem menu in MenuItems)
                    {
                        jsTree.Add(new JsTreeModel
                        {
                            id     = menu.Id.ToString(),
                            parent = (menu.Padre.Id == 0) ? "#" : menu.Padre.Id.ToString(),
                            text   = menu.Nombre,
                            data   = new JsTreeModel_data
                            {
                                idp = (menu.Padre.Id == 0) ? "#" : menu.Padre.Id.ToString(),
                                nop = menu.Padre.Texto,
                            },
                            state = new JsTreeModelState
                            {
                                opened = true
                            }
                        });
                    }
                    globalResponse.DATA = jsTree;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(jsTree, JsonRequestBehavior.AllowGet));
        }
Beispiel #22
0
        public ActionResult SVkwTXVC(string sid)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            int id = 0;

            if (User != null)
            {
                try
                {
                    if (sid != string.Empty)
                    {
                        id = Convert.ToInt16(Peach.DecriptText(sid));
                    }
                    BEParametroItem detalle = new BEParametroItem
                    {
                        Id       = Convert.ToInt16(id),
                        RowAudit = new IRowAudit
                        {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        }
                    };
                    oResponse           = new BLParametro().EliminarDetalle(detalle);
                    globalResponse.DATA = oResponse;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }

            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #23
0
        public ActionResult aytQVy91(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var id = (model[3] == "0") ? model[3] : Peach.DecriptText(model[3]);

                    BEPerfil Perfil = new BEPerfil
                    {
                        Nombre      = model[0].Trim().ToUpper(),
                        Abreviatura = model[1].Trim().ToUpper(),
                        Descripcion = model[2].Trim().ToUpper(),
                        Id          = Convert.ToInt16(id),
                        RowAudit    = new Entidad.Primitivos.IRowAudit
                        {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        }
                    };

                    oResponse           = new BLPerfil().Grabar(Perfil);
                    globalResponse.DATA = oResponse;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #24
0
        public ActionResult S2lFNm44()
        {
            CustomJSON globalResponse = new CustomJSON();
            string     _err           = string.Empty;

            if (User != null)
            {
                try
                {
                    globalResponse.DATA = new BLParametro().Listar();
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }

            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// Graba los datos generales del Organo de Servicio Exterior
        /// </summary>
        /// <param name="model">Areglo con datos</param>
        /// <returns></returns>
        public ActionResult aTIya1Nr(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var nom = model[0].Trim().ToUpper();
                    var abr = model[1].Trim().ToUpper();
                    var tpo = model[2];
                    var pai = model[3];
                    var cod = model[4].Trim().ToUpper();
                    var jse = model[5];
                    var sid = model[6];

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre para el Órgano de Servicio";
                    }
                    else if (abr == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado un nombre abreviado para el Órgano de Servicio";
                    }
                    else if (tpo == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el tipo de Organo de Servicio";
                    }
                    else if (pai == null)
                    {
                        globalResponse.ERR = "No ha seleccionado el país del Organo de Servicio";
                    }
                    else
                    {
                        BEOrganoServicio OrganoServicio = new BEOrganoServicio
                        {
                            Id          = (sid != "0") ? Convert.ToInt16(Peach.DecriptFromBase64(sid)) : 0,
                            Nombre      = nom,
                            Abreviatura = abr,
                            TipoOrgano  = new ItemGenerico {
                                Id = Convert.ToInt16(Peach.DecriptText(tpo))
                            },
                            Pais = new BEPais {
                                Id = Convert.ToInt16(Peach.DecriptFromBase64(pai))
                            },
                            CodigoInterop    = cod,
                            JefaturaServicio = new ItemGenerico {
                                Id = Convert.ToInt16(Peach.DecriptText(jse))
                            },
                            RowAudit = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };

                        oResponse           = new BLOrganoServicio().Grabar(OrganoServicio);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #26
0
        public ActionResult bi8wZz09(List <string> dat, string[] mnd)
        {
            CustomJSON      globalResponse = new CustomJSON();
            ResponserData   oResponse      = new ResponserData();
            List <BEMoneda> Monedas        = new List <BEMoneda>();
            BEPais          Pais           = new BEPais();

            if (User != null)
            {
                try
                {
                    var nom = dat[0].Trim().ToUpper();
                    var ofi = dat[1].Trim().ToUpper();
                    var gen = dat[2].Trim().ToUpper();
                    var m49 = dat[3].Trim().ToUpper();
                    var iso = dat[4].Trim().ToUpper();
                    var reg = dat[5];
                    var sid = (dat[6] == "0") ? dat[6] : Peach.DecriptText(dat[6]);

                    Pais.Nombre     = nom;
                    Pais.Oficial    = ofi;
                    Pais.Gentilicio = gen;
                    Pais.M49        = m49;
                    Pais.ISOA3      = iso;

                    Pais.Region = new BERegion {
                        Id = Convert.ToInt16(Peach.DecriptText(reg))
                    };
                    Pais.Id = Convert.ToInt16(sid);

                    if (mnd != null)
                    {
                        foreach (var m in mnd)
                        {
                            string sidm = Peach.DecriptText(m);
                            Monedas.Add(new BEMoneda {
                                Id = Convert.ToInt16(sidm)
                            });
                        }
                    }

                    Pais.Monedas  = Monedas;
                    Pais.RowAudit = new IRowAudit
                    {
                        IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                        IP   = Common.PageUtility.GetUserIpAddress()
                    };

                    oResponse           = new BLPais().Grabar(Pais);
                    globalResponse.DATA = oResponse;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #27
0
        public ActionResult enNBUT09(List <string> dat)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();
            BEMoneda      Moneda         = new BEMoneda();

            if (User != null)
            {
                try
                {
                    var nom = dat[0].Trim().ToUpper();
                    var abr = dat[1].Trim();
                    var suf = dat[2].Trim();
                    var sim = dat[3].Trim();
                    var iso = dat[4].Trim().ToUpper();
                    var asg = dat[5];
                    var sid = dat[6];

                    if (nom == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado el nombre";
                    }
                    else if (iso == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado el ISO";
                    }
                    else
                    {
                        var i_sid = (sid == "0") ? 0 : Convert.ToInt16(Peach.DecriptText(sid));

                        Moneda.Nombre         = nom;
                        Moneda.Abreviatura    = abr;
                        Moneda.SufijoContable = suf;
                        Moneda.Simbolo        = sim;
                        Moneda.ISO4217        = iso;
                        Moneda.Asignable      = new ItemGenerico {
                            IntValue = Convert.ToInt16(asg)
                        };
                        Moneda.Id = i_sid;

                        Moneda.RowAudit = new IRowAudit
                        {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        };

                        oResponse           = new BLMoneda().Grabar(Moneda);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
Beispiel #28
0
        public ActionResult RUJJa3Np(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            string _err = string.Empty;
            int    idp  = 0;
            int    idd  = 0;
            int    ord  = 0;

            if (User != null)
            {
                try
                {
                    var sip  = model[0].Trim();
                    var tex  = model[1].Trim().ToUpper();
                    var val  = model[2].Trim().ToUpper();
                    var ayu  = model[3].Trim().ToUpper();
                    var _ord = model[4].Trim();
                    var grp  = model[5];
                    var sid  = model[6].Trim();

                    if (tex == string.Empty)
                    {
                        globalResponse.ERR = "No ha ingresado el texto del parámetro";
                    }
                    else
                    {
                        if (_ord != string.Empty)
                        {
                            bool isnum = int.TryParse(_ord, out ord);
                            if (!isnum)
                            {
                                ord = 0;
                            }
                        }

                        if (sip != string.Empty)
                        {
                            idp = Convert.ToInt16(Peach.DecriptText(sip));
                        }
                        if (sid != string.Empty)
                        {
                            idd = Convert.ToInt16(Peach.DecriptText(sid));
                        }

                        BEParametro parametro = new BEParametro()
                        {
                            Id      = idp,
                            Detalle = new BEParametroItem
                            {
                                Id      = idd,
                                Texto   = tex,
                                Valor   = val,
                                Ayuda   = ayu,
                                Orden   = ord,
                                IsGrupo = new ItemGenerico
                                {
                                    IntValue = (grp == "True") ? 1 : 0
                                },
                            },
                            RowAudit = new IRowAudit
                            {
                                IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                                IP   = Common.PageUtility.GetUserIpAddress()
                            }
                        };
                        oResponse           = new BLParametro().GrabarDetalle(parametro);
                        globalResponse.DATA = oResponse;
                    }
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }
 public void GotCustomJSONNotification(CustomJSON p0, TrackingInfo p1)
 {
     Console.WriteLine("GotCustomJSONNotification ", p0.NotificationMessage);
 }
Beispiel #30
0
        /// <summary>
        /// Graba la opción de menú
        /// </summary>
        /// <returns>Json</returns>
        public ActionResult TW5UTjZN(List <string> model)
        {
            CustomJSON    globalResponse = new CustomJSON();
            ResponserData oResponse      = new ResponserData();

            if (User != null)
            {
                try
                {
                    var sid = model[0];
                    var pad = model[1];
                    var nom = model[2];
                    var des = model[3];
                    var con = model[4];
                    var met = model[5];
                    var par = model[6];
                    var url = model[7];
                    var ico = model[8];
                    var ord = model[9];
                    var pop = model[10];
                    var vis = model[11];
                    var grp = model[12];

                    var e = User;

                    BEMenuItem Item = new BEMenuItem
                    {
                        Id    = Convert.ToInt16(model[0]),
                        Padre = new ItemGenerico
                        {
                            Id = Convert.ToInt16(model[1])
                        },
                        Nombre      = model[2].Trim(),
                        Descripcion = model[3].Trim(),
                        Controlador = model[4].Trim(),
                        Metodo      = model[5].Trim(),
                        Parametro   = model[6].Trim(),
                        Url         = model[7].Trim(),
                        Icono       = model[8].Trim(),
                        Orden       = (model[9] == string.Empty) ? 0 : Convert.ToInt16(model[9]),
                        IsPopup     = new ItemGenerico
                        {
                            IntValue = Convert.ToInt16(model[10])
                        },
                        IsVisible = new ItemGenerico
                        {
                            IntValue = Convert.ToInt16(model[11])
                        },
                        IsGrupo = new ItemGenerico
                        {
                            IntValue = Convert.ToInt16(model[12])
                        },
                        RowAudit = new IRowAudit
                        {
                            IUsr = Convert.ToInt16(Peach.DecriptText(User.CID)),
                            IP   = Common.PageUtility.GetUserIpAddress()
                        }
                    };

                    oResponse           = new BLMenu().Grabar(Item);
                    globalResponse.DATA = oResponse;
                }
                catch (Exception ex)
                {
                    globalResponse.ERR = ex.Message;
                }
            }
            else
            {
                return(RedirectToAction("Index", "Account", new { act = "timeout" }));
            }
            return(Json(globalResponse, JsonRequestBehavior.AllowGet));
        }