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)); }
/// <summary> /// Devuelve todos los continentes registrados en la aplicación /// </summary> /// <returns>IEnumerable BEContinente</returns> public IEnumerable <BEContinente> Listar_Continentes() { List <BEContinente> Continentes = new List <BEContinente>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_continentes, oConexion); oComando.CommandType = CommandType.StoredProcedure; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Continentes.Add(new BEContinente { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])), Nombre = DataUtil.ObjectToString(dr["s_nom"]), CodigoONU = DataUtil.ObjectToString(dr["s_onu"]) }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Continentes); }
/// <summary> /// Devuelve la lista completa de paises para el control selector /// </summary> /// <returns></returns> public IEnumerable <BEPais> Listar_ToSelect() { List <BEPais> Paises = new List <BEPais>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar, oConexion); oComando.CommandType = CommandType.StoredProcedure; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Paises.Add(new BEPais { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])), Nombre = DataUtil.ObjectToString(dr["s_pai"]), }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Paises); }
/// <summary> /// Devuelve los datos de un banco según su id /// </summary> /// <param name="id">Id del banco</param> /// <returns>BEBanco</returns> public BEBanco Listar_byId(int id) { BEBanco Banco = new BEBanco(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_byId, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_sid", SqlDbType.Int).Value = id; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Banco.CID = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["i_sid"])); Banco.Nombre = DataUtil.ObjectToString(dr["s_nom"]); Banco.Url = DataUtil.ObjectToString(dr["s_url"]); Banco.Situacion = new ItemGenerico { IntValue = DataUtil.ObjectToInt(dr["i_sit"]) }; } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Banco); }
/// <summary> /// Devuelve las regiones asociadas a un continente registrados en la aplicación /// </summary> /// <returns>IEnumerable BERegion</returns> public IEnumerable <BERegion> Listar_Regiones_byContinente(int sid) { List <BERegion> Regiones = new List <BERegion>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_regiones_bycn, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_con", SqlDbType.Int).Value = sid; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Regiones.Add(new BERegion { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])), Nombre = DataUtil.ObjectToString(dr["s_nom"]), CodigoONU = DataUtil.ObjectToString(dr["s_onu"]) }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Regiones); }
private void InicializeFruits() { Fruit apple = new Apple(2, 3, GraphicsFruit); Fruit banana = new Banana(6, 8, GraphicsFruit); Fruit brezel = new Brezel(15, 6, GraphicsFruit); Fruit cherry = new Cherry(19, 2, GraphicsFruit); Fruit peach = new Peach(13, 4, GraphicsFruit); Fruit pear = new Pear(11, 12, GraphicsFruit); Fruit strawberry = new Strawberry(4, 10, GraphicsFruit); fruits = new List <Fruit> { apple, banana, brezel, cherry, peach, pear, strawberry }; foreach (var fruit in fruits) { string[] placeAvailable = AvailableFruitXY().Split(); int placeFruitX = int.Parse(placeAvailable[0]); int placeFruitY = int.Parse(placeAvailable[1]); fruit.FruitPositionX = placeFruitX; fruit.FruitPositionY = placeFruitY; } fruits.RemoveAll(x => x.FruitPositionX >= Global.XMax || x.FruitPositionY >= Global.YMax); }
//: Selector agencias de bancos intermedios /// <summary> /// Devuelves todas las agencias de uso intermedio para transferencias bancarias. /// </summary> public IEnumerable <BEAgenciaBancaria> ListarAgencias_BancoIntermedios_toSelect() { List <BEAgenciaBancaria> Agencias = new List <BEAgenciaBancaria>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listarintermedios_toselect, oConexion); oComando.CommandType = CommandType.StoredProcedure; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Agencias.Add(new BEAgenciaBancaria { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_agesid"])), Nombre = DataUtil.ObjectToString(dr["s_agenom"]) }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Agencias); }
public PartialViewResult GetCustomMenu(string selectController, string selectMethod) { CustomMenuModel model = new CustomMenuModel(); if (Request.IsAuthenticated) { try { if (User.CID != null) { // Obtener el perfil del usuario var IdPerfil = Convert.ToInt16(Peach.DecriptText(User.Perfil_CID)); model.ItemsMenu = new BLMenu().getMenu_byPerfil(IdPerfil).Where(e => e.IsVisible.IntValue == 1).ToList(); model.selectController = (selectController != null) ? selectController : string.Empty; model.selectMethod = (selectMethod != null) ? selectMethod : string.Empty; } else { AddToastMessage(string.Empty, "Su sesión expiró. Ingrese nuevamente a la aplicación.", BootstrapAlertType.danger); } } catch (Exception ex) { AddToastMessage(string.Empty, ex.Message, BootstrapAlertType.danger); } } else { AddToastMessage(string.Empty, "Su sesión expiró. Ingrese nuevamente a la aplicación.", BootstrapAlertType.danger); } return(PartialView("_CustomMenu", model)); }
protected void Application_PostAuthenticateRequest(Object sender, EventArgs e) { HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName]; if (authCookie != null) { JavaScriptSerializer serializer = new JavaScriptSerializer(); FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value); var data = Peach.DecriptText(authTicket.UserData); CustomPrincipalTicket _dataTicket = serializer.Deserialize <CustomPrincipalTicket>(data); CustomPrincipal CustomPrincipalLogin = new CustomPrincipal(authTicket.Name); CustomPrincipalLogin.CID = _dataTicket.CID; CustomPrincipalLogin.Usuario = _dataTicket.Usuario; CustomPrincipalLogin.Unidad_CID = _dataTicket.Unidad_CID; CustomPrincipalLogin.Unidad_Nombre = _dataTicket.Unidad_Nombre; CustomPrincipalLogin.OrganoServicio_CID = _dataTicket.OrganoServicio_CID; CustomPrincipalLogin.OrganoServicio_Nombre = _dataTicket.OrganoServicio_Nombre; CustomPrincipalLogin.OrganoServicio_Abr = _dataTicket.OrganoServicio_Abr; if (_dataTicket.Perfil_CID != null) { CustomPrincipalLogin.Perfil_CID = _dataTicket.Perfil_CID; CustomPrincipalLogin.Perfil_Nombre = _dataTicket.Perfil_Nombre; } HttpContext.Current.User = CustomPrincipalLogin; } }
/// <summary> /// Devuelve un solo perfil de la aplicación /// </summary> /// <returns></returns> public BEPerfil Listar_byId(int Id) { BEPerfil Perfil = new BEPerfil(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_idp", SqlDbType.Int).Value = Id; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Perfil.CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_persid"])); Perfil.Nombre = DataUtil.ObjectToString(dr["s_pernom"]); Perfil.Abreviatura = DataUtil.ObjectToString(dr["s_perabr"]); Perfil.Descripcion = DataUtil.ObjectToString(dr["s_perdes"]); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Perfil); }
public ActionResult Perfil(PerfilLoginModel model) { if (ModelState.IsValid) { // Ticket de cookie CustomPrincipalTicket _dataTicket = new CustomPrincipalTicket { CID = User.CID, Usuario = User.Usuario, Unidad_Nombre = User.Unidad_Nombre, OrganoServicio_CID = User.OrganoServicio_CID, OrganoServicio_Nombre = User.OrganoServicio_Nombre, OrganoServicio_Abr = User.OrganoServicio_Abr, Rol_Accion = User.Rol_Accion, Perfil_CID = model.Perfil.CID, Perfil_Nombre = model.SelectPerfil }; SessionHelper.DestroyUserSession(); JavaScriptSerializer serializer = new JavaScriptSerializer(); string userData = serializer.Serialize(_dataTicket); SessionHelper.AddUserToSession(Peach.EncriptText(userData)); } else { AddToastMessage("Error", "El modelo de datos de seleccion de perfil no es válido", BootstrapAlertType.danger); } return(RedirectToAction("Index", "Home")); }
/// <summary> /// Devuelve la lista de proveedores de un organo de servicio para el control selector del formato de egreso /// </summary> /// <param name="sid_ose">Id del proveedor</param> /// <returns></returns> public IEnumerable <BEProveedor> Listarby_OSE(int sid_ose) { List <BEProveedor> Proveedores = new List <BEProveedor>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_proveedores_ose, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_sid", SqlDbType.SmallInt).Value = sid_ose; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Proveedores.Add(new BEProveedor { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])), Nombre = DataUtil.ObjectToString(dr["s_pro"]) }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Proveedores); }
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)); }
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)); }
/// <summary> /// Devuelve la lista del personal local para el usuario administrador /// </summary> /// <param name="pageNumber">Número de página</param> /// <param name="pageRows">Cantidad de registros por página</param> /// <param name="search">Buscador</param> /// <param name="sort">Orden</param> /// <param name="dir">Dirección del orden</param> /// <param name="totalRows">Total de registros</param> /// <returns></returns> public IEnumerable <BEPersonalLocal_DTAdmin> Listar_byAdm_ToDT(int pageNumber, int pageRows, string search, int sort, string dir, ref int totalRows) { List <BEPersonalLocal_DTAdmin> Personas = new List <BEPersonalLocal_DTAdmin>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_todt, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_page_nmber", SqlDbType.Int).Value = pageNumber; oComando.Parameters.Add("@p_page_rows", SqlDbType.Int).Value = pageRows; oComando.Parameters.Add("@p_page_search", SqlDbType.VarChar, 35).Value = search; oComando.Parameters.Add("@p_page_sort", SqlDbType.Int).Value = sort; oComando.Parameters.Add("@p_page_dir", SqlDbType.VarChar, 4).Value = dir; oComando.Parameters.Add("@p_page_flt", SqlDbType.VarChar, 4).Value = 0; oComando.Parameters.Add("@p_rows_totl", SqlDbType.Int).Direction = ParameterDirection.Output; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Personas.Add(new BEPersonalLocal_DTAdmin { Row = DataUtil.ObjectToInt(dr["i_row"]), CID = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["s_per_sid"])), Pais = DataUtil.ObjectToString(dr["s_per_pai"]), Tipo = DataUtil.ObjectToString(dr["s_ose_tip"]), OSE = DataUtil.ObjectToString(dr["s_ose_abr"]), SitLab = DataUtil.ObjectToString(dr["s_sit_lab"]), Personal = DataUtil.ObjectToString(dr["s_per_ape"]), Sueldo = DataUtil.ObjectToString(dr["s_sue_bas"]), Moneda = DataUtil.ObjectToString(dr["s_sue_mon"]), Estado = new ItemGenerico { IntValue = DataUtil.ObjectToInt(dr["i_sit_est"]), StrValue = DataUtil.ObjectToString(dr["s_sit_est"]) } }); } } totalRows = DataUtil.ObjectToInt(oComando.Parameters["@p_rows_totl"].Value); oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Personas); }
/// <summary> /// Devuelve las monedas vinculadas al pais del personal local /// </summary> /// <param name="id">Id del Personal Local</param> /// <returns>IEnumerables Moneda</returns> public IEnumerable <BEMoneda> Listar_Select_byPL(int id) { List <BEMoneda> Monedas = new List <BEMoneda>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_byPersonalLocal, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_sid", SqlDbType.SmallInt).Value = id; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Monedas.Add(new BEMoneda { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_sid"])), Nombre = DataUtil.ObjectToString(dr["s_nom"]) }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Monedas); }
/// <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); }
/// <summary> /// Devuelve el personal directivo de una mision (diplomaticos y administrativos lima) /// </summary> /// <param name="id">Id de la cuenta corriente</param> /// <returns>BECuentaCorriente</returns> public IEnumerable <BEPersonalLocal> Listar_Directivo_toSelect_byOse(int id) { List <BEPersonalLocal> Personas = new List <BEPersonalLocal>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_personal_toselect, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_ose", SqlDbType.Int).Value = id; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Personas.Add(new BEPersonalLocal { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_persid"])), Apellidos = DataUtil.ObjectToString(dr["s_pernom"]) }); } ; } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Personas); }
/// <summary> /// Devuelve los datos de organos de servicio para un control selector /// </summary> /// <param name="Tipo">0: Todos, [1-4] Tipos de Órganos de Servicio</param> /// <returns></returns> public IEnumerable <BEOrganoServicio> Listar_ToSelect(OrganosServicioType Tipo) { List <BEOrganoServicio> OrganosServicio = new List <BEOrganoServicio>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_select, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_tip", SqlDbType.SmallInt).Value = Tipo; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { OrganosServicio.Add(new BEOrganoServicio { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_osesid"])), Abreviatura = DataUtil.ObjectToString(dr["s_oseabr"]) }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(OrganosServicio); }
/// <summary> /// Devuelve las cuentas corrientes de un organo de servicio exterior específico /// </summary> /// <returns></returns> public ActionResult Cuentas() { if (User != null) { if (this.IsPermitido()) { if (User.OrganoServicio_CID == string.Empty) { return(View()); } // Obtiene los datos del usuario var U = System.Web.HttpContext.Current.User; // Obtiene la misión del usuario var osesid = Peach.DecriptText(User.OrganoServicio_CID); ViewBag.OSESID = Peach.EncriptToBase64(osesid); ViewBag.OSE = User.OrganoServicio_Nombre; return(View()); } else { AddToastMessage("No permitido", "Esta opcion no esta permitida para su perfil.", BootstrapAlertType.danger); return(RedirectToAction("Index", "Home")); } } else { return(RedirectToAction("Login", "Account", new { act = "timeout" })); } }
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)); }
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> /// Devuelve la lista de los programas de política exterior según el Tipo de Órgano de Servicio /// </summary> /// <param name="Tipo">Tipo de Órgano de Servicio</param> /// <returns></returns> public IEnumerable <BEPrograma> Listar_byOSE(OrganosServicioType Tipo) { List <BEPrograma> Programas = new List <BEPrograma>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_listar_byOSE, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_sid", SqlDbType.Int).Value = (int)Tipo; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Programas.Add(new BEPrograma { CID = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["i_sid"])), Nombre = DataUtil.ObjectToString(dr["s_nom"]), Abreviatura = DataUtil.ObjectToString(dr["s_abr"]) }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Programas); }
public void GivenThereIsAGameOfPlayerAWithHealthAndPlayerBHasHealth(int p0, int p1) { playerA = new Player(0, "PA", "Player A", p0); playerB = new Player(1, "PB", "Player B", p1); Player[] players = new Player[2]; players[0] = playerA; players[1] = playerB; List <Card> ls = new List <Card>(); wine = new Wine(CardSuit.Club, 1); ls.Add(wine); ls.Add(wine); ls.Add(wine); ls.Add(wine); ls.Add(wine); attack = new Attack(CardSuit.Club, 2); ls.Add(attack); ls.Add(attack); ls.Add(attack); ls.Add(attack); ls.Add(attack); peach = new Peach(CardSuit.Heart, 3); ls.Add(peach); ls.Add(peach); ls.Add(peach); ls.Add(peach); game = new Game(players, new FakeCardSet(ls)); game.start(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)); }
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" })); } }
/// <summary> /// Devuelve lista de personal local para el registro de gastos /// </summary> /// <param name="sid">Id del OSE</param> /// <returns></returns> public List <BEPersonalLocal> Get_PersonalGasto(int sid) { List <BEPersonalLocal> Personal = new List <BEPersonalLocal>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_devolverlistapersonal, oConexion); oComando.CommandType = CommandType.StoredProcedure; oComando.Parameters.Add("@p_sid", SqlDbType.Int).Value = sid; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Personal.Add(new BEPersonalLocal { CID = Peach.EncriptToBase64(DataUtil.ObjectToString(dr["sid"])), Apellidos = DataUtil.ObjectToString(dr["nom"]) }); } ; } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Personal); }
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)); }
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)); }
/// <summary> /// Devuelve las cuentas de cargo para el formato de egreso /// </summary> /// <returns></returns> public IEnumerable <BECuentaCorriente> ListarCuentasCargo(int sid_usr) { List <BECuentaCorriente> Cuentas = new List <BECuentaCorriente>(); try { using (SqlConnection oConexion = new SqlConnection(DBConexion)) { SqlCommand oComando = new SqlCommand(sp_selector_cuentacargo_formatoegreso, oConexion); oComando.Parameters.Add("@p_sid", SqlDbType.Int).Value = sid_usr; oComando.CommandType = CommandType.StoredProcedure; oConexion.Open(); using (SqlDataReader dr = oComando.ExecuteReader()) { while (dr.Read() && dr.HasRows) { Cuentas.Add(new BECuentaCorriente { CID = Peach.EncriptText(DataUtil.ObjectToString(dr["i_ctasid"])), NumeroCuenta = DataUtil.ObjectToString(dr["s_resumn"]) }); } } oComando.Dispose(); } } catch (Exception ex) { throw ex; } return(Cuentas); }
void Wake() { prin = GameObject.FindGameObjectWithTag("Princesa"); p = prin.GetComponent<Peach>(); }