Beispiel #1
0
        /// <summary>
        /// Graba un conjunto de opciones del menú asociados a un perfil
        /// </summary>
        /// <param name="model">BEPerfil</param>
        /// <returns></returns>
        public ResponserData Grabar_byPerfil(BEPerfil model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_reset_items_byperfil, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_idp", SqlDbType.Int).Value         = model.Id;
                    oComando.Parameters.Add("@p_usr", SqlDbType.VarChar, 12).Value = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    oComando.ExecuteNonQuery();
                    oComando.Dispose();
                }

                foreach (BEMenuItem opcion in model.OpcionesMenu)
                {
                    this.GrabarOpcion_byPerfil(model.Id, opcion.Id, opcion.RowAudit.IUsr, opcion.RowAudit.IP);
                }

                Responser.Mensaje    = "Las opciones fueron asociadas al perfil.";
                Responser.Estado     = ResponserEstado.Ok;
                Responser.TipoAlerta = BootstrapAlertType.success;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #2
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));
        }
        /// <summary>
        /// Graba o actualiza los datos del contrato de un trabajador
        /// </summary>
        /// <param name="model">modelo</param>
        /// <returns>ResponserData</returns>
        public ResponserData GrabarContrato(BEPersonalLocal model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar_contrato, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_sid", SqlDbType.SmallInt).Value     = model.Contrato.Id;
                    oComando.Parameters.Add("@p_per_sid", SqlDbType.SmallInt).Value = model.Id;
                    oComando.Parameters.Add("@p_ose_sid", SqlDbType.SmallInt).Value = model.OrganoServicio.IntValue;
                    oComando.Parameters.Add("@p_con_tip", SqlDbType.SmallInt).Value = model.Contrato.TipoContrato.IntValue;
                    oComando.Parameters.Add("@p_con_ref", SqlDbType.SmallInt).Value = model.Contrato.Referencia.IntValue;

                    oComando.Parameters.Add("@p_con_num", SqlDbType.VarChar, 25).Value = model.Contrato.Numero;
                    oComando.Parameters.Add("@p_con_fec", SqlDbType.VarChar, 10).Value = model.Contrato.FechaContrato;
                    oComando.Parameters.Add("@p_con_ini", SqlDbType.VarChar, 10).Value = model.Contrato.FechaInicio;
                    oComando.Parameters.Add("@p_con_fin", SqlDbType.VarChar, 10).Value = model.Contrato.FechaTermino;

                    oComando.Parameters.Add("@p_con_ind", SqlDbType.Bit).Value = model.Contrato.Indefinido;

                    oComando.Parameters.Add("@p_con_car", SqlDbType.SmallInt).Value       = model.Contrato.Cargo.IntValue;
                    oComando.Parameters.Add("@p_con_mon", SqlDbType.SmallInt).Value       = model.Contrato.Moneda.IntValue;
                    oComando.Parameters.Add("@p_con_rem", SqlDbType.Decimal).Value        = model.Contrato.RemuneracionBruta;
                    oComando.Parameters.Add("@p_con_fun", SqlDbType.VarChar, 10).Value    = model.Contrato.FechaInicioFuncion;
                    oComando.Parameters.Add("@p_con_aut", SqlDbType.VarChar, 25).Value    = model.Contrato.DocumentoAutorizacion;
                    oComando.Parameters.Add("@p_con_autfec", SqlDbType.VarChar, 10).Value = model.Contrato.FechaAutorizacion;

                    oComando.Parameters.Add("@p_con_tco", SqlDbType.SmallInt).Value = model.Contrato.TipoContrato.IntValue;
                    oComando.Parameters.Add("@p_con_obs", SqlDbType.VarChar).Value  = (model.Contrato.Observacion == null) ? string.Empty : model.Contrato.Observacion;

                    oComando.Parameters.Add("@p_con_sit", SqlDbType.SmallInt).Value = model.Contrato.Situacion.IntValue;


                    oComando.Parameters.Add("@p_usr", SqlDbType.VarChar, 12).Value = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.CID        = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["i_id"]));
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #4
0
        /// <summary>
        /// Graba o actualiza los datos de un perfil asociados a un usuario
        /// </summary>
        /// <param name="model">modelo</param>
        /// <returns>ResponserData</returns>
        public void Grabar_byPerfilUsuario(BEPerfil model, int idu)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_graba_perfil_usuario, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_idu", SqlDbType.Int).Value = idu;
                    oComando.Parameters.Add("@p_idp", SqlDbType.Int).Value = model.Id;

                    oComando.Parameters.Add("@p_usr", SqlDbType.VarChar, 12).Value = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    oComando.ExecuteNonQuery();
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #5
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 #6
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 #7
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 #8
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 #9
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));
        }
        /// <summary>
        /// Graba o actualiza los datos de un trabajador local
        /// </summary>
        /// <param name="model">modelo</param>
        /// <returns>ResponserData</returns>
        public ResponserData Grabar(BEPersonalLocal model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar_general, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_sid", SqlDbType.Int).Value = model.Id;
                    oComando.Parameters.Add("@p_ido", SqlDbType.Int).Value = model.OrganoServicio.IntValue;

                    oComando.Parameters.Add("@p_ape", SqlDbType.VarChar, 45).Value = model.Apellidos;
                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 45).Value = model.Nombres;
                    oComando.Parameters.Add("@p_fna", SqlDbType.VarChar, 10).Value = model.FechaNacimiento;

                    oComando.Parameters.Add("@p_gen", SqlDbType.SmallInt).Value = model.Genero.IntValue;
                    oComando.Parameters.Add("@p_dis", SqlDbType.Bit).Value      = model.Discapacidad.IntValue;
                    oComando.Parameters.Add("@p_nac", SqlDbType.SmallInt).Value = model.Nacionalidad.IntValue;

                    oComando.Parameters.Add("@p_tdc", SqlDbType.Int).Value         = model.TipoDocumento.IntValue;
                    oComando.Parameters.Add("@p_ndc", SqlDbType.VarChar, 25).Value = model.NumeroDocumento;
                    oComando.Parameters.Add("@p_mai", SqlDbType.VarChar, 60).Value = model.Email;

                    oComando.Parameters.Add("@p_ecv", SqlDbType.SmallInt).Value = model.EstadoCivil.IntValue;
                    oComando.Parameters.Add("@p_grd", SqlDbType.SmallInt).Value = model.GradoProfesional.IntValue;
                    oComando.Parameters.Add("@p_esp", SqlDbType.SmallInt).Value = model.Especialidad.IntValue;
                    oComando.Parameters.Add("@p_tps", SqlDbType.SmallInt).Value = model.TipoPersonal.IntValue;

                    oComando.Parameters.Add("@p_obs", SqlDbType.VarChar).Value  = model.Observacion;
                    oComando.Parameters.Add("@p_sla", SqlDbType.SmallInt).Value = model.SituacionLaboral.IntValue;
                    oComando.Parameters.Add("@p_sit", SqlDbType.SmallInt).Value = model.Situacion.IntValue;

                    oComando.Parameters.Add("@p_usr", SqlDbType.VarChar, 12).Value = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.CID        = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["i_id"]));
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #11
0
        /// <summary>
        /// Graba o actualiza los datos de un pais
        /// </summary>
        /// <param name="model">modelo</param>
        /// <returns>ResponserData</returns>
        public ResponserData Grabar(BEPais model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_idp", SqlDbType.Int).Value         = model.Id;
                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 40).Value = model.Nombre;
                    oComando.Parameters.Add("@p_ofi", SqlDbType.VarChar, 60).Value = model.Oficial;
                    oComando.Parameters.Add("@p_gen", SqlDbType.VarChar, 40).Value = model.Gentilicio;
                    oComando.Parameters.Add("@p_m49", SqlDbType.VarChar, 3).Value  = model.M49;
                    oComando.Parameters.Add("@p_iso", SqlDbType.VarChar, 3).Value  = model.ISOA3;
                    oComando.Parameters.Add("@p_reg", SqlDbType.Int).Value         = model.Region.Id;

                    oComando.Parameters.Add("@p_usr", SqlDbType.VarChar, 12).Value = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.XID        = DataUtil.ObjectToInt16(dr["i_id"]);
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }

                if (Responser.XID > 0 && Responser.Estado == ResponserEstado.Ok)
                {
                    model.Id = Responser.XID;
                    foreach (BEMoneda moneda in model.Monedas)
                    {
                        model.Moneda = new BEMoneda
                        {
                            Id = moneda.Id
                        };
                        this.VincularMoneda(model);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #12
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 #13
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 #14
0
        /// <summary>
        /// Graba o actualiza los datos de un elemento de menu (opcion)
        /// </summary>
        /// <param name="model">modelo</param>
        /// <returns>ResponserData</returns>
        public ResponserData Grabar(BEMenuItem model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_ido", SqlDbType.Int).Value          = model.Id;
                    oComando.Parameters.Add("@p_idp", SqlDbType.Int).Value          = model.Padre.Id;
                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 150).Value = model.Nombre;
                    oComando.Parameters.Add("@p_des", SqlDbType.VarChar, 150).Value = model.Descripcion;

                    oComando.Parameters.Add("@p_con", SqlDbType.VarChar, 80).Value  = model.Controlador;
                    oComando.Parameters.Add("@p_met", SqlDbType.VarChar, 80).Value  = model.Metodo;
                    oComando.Parameters.Add("@p_par", SqlDbType.VarChar, 30).Value  = model.Parametro;
                    oComando.Parameters.Add("@p_url", SqlDbType.VarChar, 150).Value = model.Url;

                    oComando.Parameters.Add("@p_ico", SqlDbType.VarChar, 40).Value = model.Icono;

                    oComando.Parameters.Add("@p_ipo", SqlDbType.Bit).Value = model.IsPopup.IntValue;
                    oComando.Parameters.Add("@p_ivi", SqlDbType.Bit).Value = model.IsVisible.IntValue;
                    oComando.Parameters.Add("@p_igr", SqlDbType.Bit).Value = model.IsGrupo.IntValue;

                    oComando.Parameters.Add("@p_ord", SqlDbType.Int).Value = model.Orden;

                    oComando.Parameters.Add("@p_usr", SqlDbType.VarChar, 12).Value = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #15
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 #17
0
        /// <summary>
        /// Graba/actualiza los datos de un órgano de servicio
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ResponserData Grabar(BEOrganoServicio model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_ido", SqlDbType.Int).Value = model.Id;

                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 100).Value = model.Nombre;
                    oComando.Parameters.Add("@p_abr", SqlDbType.VarChar, 25).Value  = model.Abreviatura;
                    oComando.Parameters.Add("@p_tip", SqlDbType.Int).Value          = model.TipoOrgano.Id;
                    oComando.Parameters.Add("@p_pai", SqlDbType.Int).Value          = model.Pais.Id;
                    oComando.Parameters.Add("@p_cod", SqlDbType.VarChar, 5).Value   = model.CodigoInterop;
                    oComando.Parameters.Add("@p_jsv", SqlDbType.Int).Value          = model.JefaturaServicio.Id;

                    oComando.Parameters.Add("@p_usr", SqlDbType.SmallInt).Value    = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read() && dr.HasRows)
                        {
                            Responser.CID        = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["i_id"]));
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #18
0
        /// <summary>
        /// Graba o actualiza los datos de una agencia bancaria
        /// </summary>
        /// <param name="model">modelo</param>
        /// <returns>ResponserData</returns>
        public ResponserData GrabarAgencia(BEBanco model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar_agencia, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_ida", SqlDbType.Int).Value         = model.Agencia.Id;
                    oComando.Parameters.Add("@p_idb", SqlDbType.VarChar, 35).Value = model.Id;

                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 35).Value  = model.Agencia.Nombre;
                    oComando.Parameters.Add("@p_dir1", SqlDbType.VarChar, 35).Value = model.Agencia.Direccion1;
                    oComando.Parameters.Add("@p_dir2", SqlDbType.VarChar, 35).Value = model.Agencia.Direccion2;
                    oComando.Parameters.Add("@p_tip", SqlDbType.Int).Value          = model.Agencia.Tipo.IntValue;
                    oComando.Parameters.Add("@p_pai", SqlDbType.Int).Value          = model.Agencia.Pais.Id;

                    oComando.Parameters.Add("@p_usr", SqlDbType.SmallInt).Value    = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #19
0
        /// <summary>
        /// Graba o actualiza los datos de un banco
        /// </summary>
        /// <param name="model">modelo</param>
        /// <returns>ResponserData</returns>
        public ResponserData Grabar(BEBanco model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_idb", SqlDbType.SmallInt).Value     = model.Id;
                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 35).Value  = model.Nombre;
                    oComando.Parameters.Add("@p_url", SqlDbType.VarChar, 120).Value = model.Url;
                    oComando.Parameters.Add("@p_sit", SqlDbType.TinyInt).Value      = model.Situacion.IntValue;

                    oComando.Parameters.Add("@p_usr", SqlDbType.SmallInt).Value    = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.CID        = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["i_id"]));
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                new DAError().GrabarLog("Data", "DABanco", "Grabar",
                                        string.Concat(ex.Message, "Ip:", model.RowAudit.IP, ", Len:", model.RowAudit.IP.Length.ToString()),
                                        model.RowAudit.IUsr, model.RowAudit.IP);
                throw ex;
            }
            return(Responser);
        }
Beispiel #20
0
        /// <summary>
        /// Agrega/Actualiza un detalle de un item
        /// </summary>
        /// <param name="model">BEParametro</param>
        /// <returns></returns>
        public ResponserData GrabarDetalle(BEParametro model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabarDetalle, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_id", SqlDbType.Int).Value           = model.Detalle.Id;
                    oComando.Parameters.Add("@p_idp", SqlDbType.Int).Value          = model.Id;
                    oComando.Parameters.Add("@p_tex", SqlDbType.VarChar, 50).Value  = model.Detalle.Texto;
                    oComando.Parameters.Add("@p_val", SqlDbType.VarChar, 50).Value  = model.Detalle.Valor;
                    oComando.Parameters.Add("@p_ayu", SqlDbType.VarChar, 255).Value = model.Detalle.Ayuda;
                    oComando.Parameters.Add("@p_ord", SqlDbType.Int).Value          = model.Detalle.Orden;
                    oComando.Parameters.Add("@p_grp", SqlDbType.Bit).Value          = model.Detalle.IsGrupo.IntValue;

                    oComando.Parameters.Add("@p_usr", SqlDbType.SmallInt).Value    = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();
                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.XID        = DataUtil.ObjectToInt(dr["i_id"]);
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Responser);
        }
Beispiel #21
0
        /// <summary>
        /// Graba/actualiza los datos de un usuario
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ResponserData GrabarSolicitud(BEUsuario model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar_solicitud, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_ape", SqlDbType.VarChar, 35).Value = model.Apellidos;
                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 35).Value = model.Nombres;
                    oComando.Parameters.Add("@p_mai", SqlDbType.VarChar, 50).Value = model.Email;
                    oComando.Parameters.Add("@p_lan", SqlDbType.VarChar, 12).Value = model.Login.user;
                    oComando.Parameters.Add("@p_pas", SqlDbType.VarChar, 44).Value = model.Login.pass;
                    oComando.Parameters.Add("@p_ose", SqlDbType.Int).Value         = model.OrganoServicio.Id;

                    oComando.Parameters.Add("@p_usr", SqlDbType.SmallInt).Value    = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.XID        = DataUtil.ObjectToInt(dr["i_id"]);
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #22
0
        /// <summary>
        /// Graba o actualiza los datos de una moneda
        /// </summary>
        /// <param name="model">modelo</param>
        /// <returns>ResponserData</returns>
        public ResponserData Grabar(BEMoneda model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_idp", SqlDbType.Int).Value         = model.Id;
                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 40).Value = model.Nombre;
                    oComando.Parameters.Add("@p_abr", SqlDbType.VarChar, 20).Value = model.Abreviatura;
                    oComando.Parameters.Add("@p_suf", SqlDbType.VarChar, 15).Value = model.SufijoContable;
                    oComando.Parameters.Add("@p_sim", SqlDbType.VarChar, 5).Value  = model.Simbolo;
                    oComando.Parameters.Add("@p_iso", SqlDbType.VarChar, 3).Value  = model.ISO4217;
                    oComando.Parameters.Add("@p_asi", SqlDbType.Bit).Value         = model.Asignable.IntValue;
                    oComando.Parameters.Add("@p_usr", SqlDbType.SmallInt).Value    = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;

                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #23
0
        /// <summary>
        /// Agrega/Actualiza una unidad organica
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ResponserData Grabar(BEUnidad model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_grabar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_ido", SqlDbType.Int).Value = model.Id;

                    oComando.Parameters.Add("@p_nom", SqlDbType.VarChar, 35).Value = model.Nombre;
                    oComando.Parameters.Add("@p_abr", SqlDbType.VarChar, 10).Value = model.Abreviatura;
                    oComando.Parameters.Add("@p_des", SqlDbType.VarChar, 35).Value = model.Descripcion;
                    oComando.Parameters.Add("@p_usu", SqlDbType.Int).Value         = model.UnidadSuperior.Id;

                    oComando.Parameters.Add("@p_usr", SqlDbType.VarChar, 12).Value = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();
                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.CID        = DataUtil.ObjectToString(dr["i_id"]);
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToByte(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Responser);
        }
Beispiel #24
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 #25
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 #26
0
        // Elimina un parámetro
        public ResponserData Eliminar(BEParametro model)
        {
            ResponserData Responser = new ResponserData();

            try
            {
                using (SqlConnection oConexion = new SqlConnection(DBConexion))
                {
                    SqlCommand oComando = new SqlCommand(sp_eliminar, oConexion);
                    oComando.CommandType = CommandType.StoredProcedure;

                    oComando.Parameters.Add("@p_id", SqlDbType.Int).Value = model.Id;

                    oComando.Parameters.Add("@p_usr", SqlDbType.VarChar, 12).Value = model.RowAudit.IUsr;
                    oComando.Parameters.Add("@p_ipc", SqlDbType.VarChar, 15).Value = model.RowAudit.IP;
                    oConexion.Open();

                    using (SqlDataReader dr = oComando.ExecuteReader())
                    {
                        while (dr.Read())
                        {
                            Responser.XID        = DataUtil.ObjectToInt(dr["i_id"]);
                            Responser.Mensaje    = DataUtil.ObjectToString(dr["s_msg"]);
                            Responser.Estado     = (ResponserEstado)DataUtil.ObjectToInt(dr["i_est"]);
                            Responser.TipoAlerta = (BootstrapAlertType)DataUtil.ObjectToInt(dr["i_btp"]);
                        }
                    }
                    oComando.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Responser);
        }
Beispiel #27
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));
        }
Beispiel #28
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 #29
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 #30
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));
        }