Ejemplo n.º 1
0
        protected void BtnOrder_Click(object sender, EventArgs e)
        {
            OfferedPizza      offerPizza = HelperSession.GetOfferPizza(Session);
            List <Ingredient> listIngredientsSelected = HelperSession.GetListIngredientsSelected(Session);

            OrderPizza orderPizza = new OrderPizza(offerPizza.Id_Offered_Pizza, offerPizza.Price, listIngredientsSelected);

            List <OrderPizza> listOrdersPizza = HelperSession.GetListOrdersPizza(Session);

            listOrdersPizza.Add(orderPizza);

            HelperSession.SetListOrdersPizza(Session, listOrdersPizza);

            double partialSum = HelperSession.GetSumOrderedPizzas(Session);

            partialSum += orderPizza.Price;

            HelperSession.SetSumOrderedPizzas(Session, partialSum);

            double totalSum = Properties.Settings.Default.PriceDeliveryAndService + partialSum;

            HelperSession.SetTotalPriceOrderedPizzas(Session, totalSum);

            Response.Redirect("Basket.aspx");
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Page.Title.Contains("Untitled"))
            {
                this.Page.Title = "BAV - Banco Agricola de Venezuela";
            }
            else
            {
                this.Page.Title = string.Concat("BAV - Banco Agricola de Venezuela - ", this.Page.Title);
            }
            Principal parent   = this.Parent as Principal;
            Afiliado  afiliado = parent.Afiliado;

            if (afiliado != null)
            {
                this.Usuario = string.Concat(afiliado.sCO_Nombres.ToUpper(), " ", afiliado.sCO_Apellidos);
                if (this.TituloPage == string.Empty)
                {
                    this.TituloPage = parent.NombrePantalla;
                }
                this.Fecha = DateTime.Now.ToString("dd/MM/yyyy hh:mm");
                DateTime tiempoInicio = HelperSession.SA_GetLastSession(afiliado.nAF_Id).TiempoInicio;
                this.UltimoAcceso = tiempoInicio.ToString("dd/MM/yyyy hh:mm");
            }
        }
Ejemplo n.º 3
0
        public ResponseWs <List <Movimientos> > Movimientos(string sesion, string cta, string tipo, DateTime di, DateTime df)
        {
            HelperSession.SA_GetSession(sesion);
            ResponseWs <List <Movimientos> > responseW = new ResponseWs <List <Movimientos> >()
            {
                CodError  = 0,
                Resultado = "OK",
                Data      = new List <Movimientos>()
            };
            Movimientos movimiento = new Movimientos();

            return(responseW);
        }
Ejemplo n.º 4
0
        public void Connect()
        {
            if (_session != null)
            {
                return;
            }

            _session = new HelperSession();

            // arbitrary settings used for example code
            string         clientId = "SessionExample";
            List <Setting> settings = new List <Setting>();

            settings.Add(BuildSetting("AutoCreateDataSets", true));
            settings.Add(BuildSetting("PacketDelay", 500));

            string result = _session.Connect(_historian, clientId, settings.ToArray());
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         string item = base.Request.QueryString["SessionId"];
         if (string.IsNullOrEmpty(item))
         {
             item = this.Session["SessionId"] as string;
         }
         if (!string.IsNullOrEmpty(item))
         {
             SessionAfiliado sessionAfiliado = HelperSession.SA_GetSession(item);
             if (sessionAfiliado.SES_CodStatus.Equals("D"))
             {
                 sessionAfiliado.SES_CodStatus = "I";
                 HelperSession.SA_UpdateSession(sessionAfiliado);
             }
         }
     }
 }
Ejemplo n.º 6
0
        public ResponseWs <bool> ActualizarSesion(string sesion)
        {
            ResponseWs <bool> responseW = new ResponseWs <bool>();

            try
            {
                if (HelperSession.SA_GetSession(sesion).SES_CodStatus.Equals("A"))
                {
                    responseW.Resultado = "OK";
                }
                else
                {
                    responseW.Resultado = "FAIL";
                }
            }
            catch (Exception exception)
            {
                responseW.Resultado = "FAIL";
            }
            return(responseW);
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.liFecha.Text = DateTime.Now.ToString("dd/MM/yyyy hh:mm");
            string item = this.Session["SessionID"] as string;

            if (!string.IsNullOrEmpty(item))
            {
                SessionAfiliado now = HelperSession.SA_GetSession(item);
                if (now != null)
                {
                    now.TiempoFin     = DateTime.Now;
                    now.SES_CodStatus = "I";
                    HelperSession.SA_UpdateSession(now);
                }
            }
            else
            {
                base.Response.Redirect("~/Login.aspx");
            }
            this.Session.Abandon();
        }
Ejemplo n.º 8
0
        public ResponseWs <List <DetallesViaje> > DetallesNotificacion(string sesion)
        {
            ResponseWs <List <DetallesViaje> > responseW = new ResponseWs <List <DetallesViaje> >();
            SessionAfiliado sessionAfiliado = HelperSession.SA_GetSession(sesion);

            if (sessionAfiliado != null)
            {
                responseW.CodError  = 0;
                responseW.Resultado = "OK";
                responseW.Data      = new List <DetallesViaje>();
                foreach (DataRow row in HelperNotificacionIBP.DestinoByNotificacion(sessionAfiliado.AF_Id).Tables[0].Rows)
                {
                    responseW.Data.Add(DetallesViaje.getDetalles(row));
                }
            }
            else
            {
                responseW.CodError  = 1;
                responseW.Resultado = "FAIL";
            }
            return(responseW);
        }
Ejemplo n.º 9
0
        public ResponseWs <List <FavoritosAfiliado> > MenuFavoritos(string sesion)
        {
            ResponseWs <List <FavoritosAfiliado> > responseW = new ResponseWs <List <FavoritosAfiliado> >();
            SessionAfiliado sessionAfiliado = HelperSession.SA_GetSession(sesion);

            if (sessionAfiliado != null)
            {
                responseW.CodError  = 0;
                responseW.Resultado = "OK";
                responseW.Data      = new List <FavoritosAfiliado>();
                foreach (DataRow row in HelperFavorito.AfiliadoFavoritosGetByAfiliado(sessionAfiliado.AF_Id).Tables[0].Rows)
                {
                    responseW.Data.Add(FavoritosAfiliado.getNewFavoritosAfiliado(row));
                }
            }
            else
            {
                responseW.CodError  = 1;
                responseW.Resultado = "FAIL";
            }
            return(responseW);
        }
Ejemplo n.º 10
0
        protected void CbStatus_CheckedChanged(object sender, EventArgs e)
        {
            OfferedPizza offerPizza = HelperSession.GetOfferPizza(Session);

            List <Ingredient> listIngredientsOffer    = HelperSession.GetListIngredientsOffer(Session);
            List <Ingredient> listIngredientsSelected = HelperSession.GetListIngredientsSelected(Session);

            CheckBox    cbStatus = (CheckBox)sender;
            GridViewRow row      = (GridViewRow)cbStatus.NamingContainer;

            if (row != null)
            {
                int        index      = row.RowIndex;
                Ingredient ingredient = listIngredientsOffer[index];

                ingredient.Status = !(ingredient.Status);

                if (ingredient.Status)
                {
                    offerPizza.Price += ingredient.Price;

                    listIngredientsSelected.Add(ingredient);
                }
                else
                {
                    offerPizza.Price -= ingredient.Price;

                    listIngredientsSelected.Remove(ingredient);
                }

                listIngredientsOffer[index] = ingredient;

                LbPrice.Text = offerPizza.Price.ToString("0.00") + "";

                HelperSession.SetListIngredientsOffer(Session, listIngredientsOffer);
                HelperSession.SetListIngredientsSelected(Session, listIngredientsSelected);
                HelperSession.SetOfferPizza(Session, offerPizza);
            }
        }
Ejemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!IsPostBack)
                {
                    OfferedPizza offerPizza = HelperSession.GetOfferPizza(Session);

                    List <Ingredient> listIngredientsAll   = HelperSession.GetListIngredientsAll(Session);
                    List <Ingredient> listIngredientsOffer = HelperIngredient.Connect(offerPizza.Ingredients, listIngredientsAll);

                    HelperSession.SetListIngredientsOffer(Session, listIngredientsOffer);

                    GvListIngredients.DataSource = listIngredientsOffer;
                    GvListIngredients.DataBind();

                    LbTitle.Text = offerPizza.Name;
                    LbPrice.Text = offerPizza.Price.ToString("0.00") + "";

                    HelperSession.SetListIngredientsSelected(Session, offerPizza.Ingredients);
                }
            }
        }
Ejemplo n.º 12
0
        protected void btnlogin_Click(object sender, EventArgs e)
        {
            this.liScript.Text  = string.Empty;
            this.sError.Visible = false;
            base.ResolveUrl("~");
            this.login = this.AF_Login.Text;
            //Modificado 24/08/2018 por Liliana Guerra clave mayuscula
            //this.password = this.txtAF_Password.Text;
            this.password = this.txtAF_Password.Text.ToUpper();
            string empty = string.Empty;
            string str   = "~/frame.aspx";

            this.sError.Text = "Error en Usuario y/o Clave Personal";

            try
            {
                if (this.login.Trim().Length == 0)
                {
                    throw new Exception("El Código de usuario no puede ser blanco o nulo.");
                }
                if (this.password.Trim().Length == 0)
                {
                    throw new Exception("Debe ingresar la Clave");
                }
                this.oAfiliado = HelperAfiliado.AutenticarAfiliado(this.login, this.password, WebUtils.GetClientIP(this));
                if (this.oAfiliado != null)
                {
                    if (this.oAfiliado.AF_FechaPassword == new DateTime(2000, 1, 1))
                    {
                        this.Context.Items.Add("Afiliado", this.oAfiliado);
                        this.Context.Items.Add("type", "0");
                        base.Server.Transfer("~/pages/IB/Claves/CaducoClave.aspx");
                    }
                    else if ((this.oAfiliado.AF_DiasPassword == 0 ? false : DateAndTime.DateDiff(DateInterval.Day, this.oAfiliado.AF_FechaPassword, DateTime.Now) >= (long)this.oAfiliado.AF_DiasPassword))
                    {
                        this.Context.Items.Add("Afiliado", this.oAfiliado);
                        this.Context.Items.Add("type", "1");
                        base.Server.Transfer("~/pages/IB/Claves/CaducoClave.aspx");
                    }
                    SessionAfiliado sessionAfiliado = new SessionAfiliado();
                    try
                    {
                        sessionAfiliado = HelperSession.SA_CreateSession(this.oAfiliado.nAF_Id);
                    }
                    catch (IBException bException)
                    {
                        base.Response.Redirect("~/forcelogout.aspx", false);
                        return;
                    }
                    empty = "redirect.aspx";
                    this.oAfiliado.sIP = WebUtils.GetClientIP(this);
                    this.Session.Add("SessionID", sessionAfiliado.Sesion);
                    string[] strArrays = IBBAVConfiguration.SessionTimeOut.Split(new char[] { ':' });
                    int      num       = int.Parse(strArrays[0]) * 60 + int.Parse(strArrays[1]);
                    this.Session.Timeout = num / 60;
                    this.Session.Add("Afiliado", this.oAfiliado);
                    this.sError.Text = string.Empty;
                }
            }
            catch (IBException bException2)
            {
                IBException bException1 = bException2;
                this.txtAF_Password.Text = string.Empty;
                if (bException1.ReturnCode == "1000")
                {
                    StringBuilder stringBuilder = new StringBuilder(50);
                    stringBuilder.Append("<script language='javascript' type='text/javascript'>");
                    stringBuilder.Append("var w = window.open('pages/IB/Claves/RecuperarClave.aspx?restore=','restorepass','width=1100,height=768,menubar=0,resizable=0,toolbar=0,left=300,top=150');");
                    stringBuilder.Append("w.focus(); ");
                    stringBuilder.Append("</script>");
                    this.liScript.Text = stringBuilder.ToString();
                }
                else
                {
                    this.sError.Text    = bException1.IBMessage;
                    this.sError.Visible = true;
                    this.divmsg.Visible = true;
                    return;
                }
            }
            catch (Exception exception)
            {
                this.sError.Text    = exception.Message;
                this.sError.Visible = true;
                return;
            }
            if (!empty.Equals(string.Empty))
            {
                this.LogLoginSuccessfull();
                base.Response.Redirect(str);
            }
        }
Ejemplo n.º 13
0
 protected override void OnPreLoad(EventArgs e)
 {
     this.sCod = (string.IsNullOrEmpty(base.Request.QueryString["sCod"]) ? 0 : int.Parse(base.Request.QueryString["sCod"]));
     try
     {
         TransMaxMin maxMinTransaccion = HelperMenu.getMaxMinTransaccion(this.sCod, 0);
         if (maxMinTransaccion != null)
         {
             this.Max = maxMinTransaccion.MD_Mto_Max_Bco;
             this.Min = maxMinTransaccion.MD_Mto_Min_Bco;
             // Agregado 21/07/2018 por Liliana Guerra Limite por transacción
             this.MtoLimiteTrans = maxMinTransaccion.MD_Mto_Limite_Trans;
             this.LimiteDiario   = maxMinTransaccion.MD_Mto_Limite_Diario;
             if (string.IsNullOrEmpty(this.NombrePantalla))
             {
                 this.NombrePantalla = maxMinTransaccion.MD_Desc_Trans;
             }
             this.MontoComision         = maxMinTransaccion.MD_Mto_Comision;
             this.CuentaAdministrativa1 = maxMinTransaccion.MD_Cta_Administrativa1;
             this.CuentaAdministrativa2 = maxMinTransaccion.MD_Cta_administrativa2;
             this.Tipo_Seguridad        = maxMinTransaccion.MD_Tipo_Seguridad;
         }
     }
     catch (IBException bException)
     {
     }
     this.path = base.ResolveUrl("~");
     if (!base.IsCallback)
     {
         this.SessionId = base.Request.QueryString["SessionId"];
         if (string.IsNullOrEmpty(this.SessionId))
         {
             this.SessionId = this.Session["SessionId"] as string;
         }
         HelperSession.ValidateSession(this.SessionId);
         this.Afiliado = this.Session["Afiliado"] as IBBAV.Entidades.Afiliado;
         if (this.Afiliado == null)
         {
             base.Response.Redirect("~/Login.aspx?msg=2");
         }
         else if (this.Afiliado.nES_Id == (long)4)
         {
             this.sesionnovalida = true;
             base.Response.Redirect("~/Login.aspx?msg=4");
         }
         else if (this.Afiliado.nES_Id != (long)6)
         {
             if (this.Afiliado.nES_Id == (long)8)
             {
                 this.sesionnovalida = true;
                 base.Response.Redirect("~/Login.aspx?msg=6");
                 return;
             }
             if (this.Context.Items["Afiliado"] == null)
             {
                 this.Context.Items.Add("Afiliado", this.Afiliado);
             }
             else
             {
                 this.Context.Items["Afiliado"] = this.Afiliado;
             }
             if (!base.Request.RawUrl.Contains("CambioClave.aspx"))
             {
                 if (this.Afiliado.AF_FechaPassword == new DateTime(2000, 1, 1))
                 {
                     base.Response.Redirect(string.Concat("~/pages/IB/Claves/CambioClave.aspx?sCod=20&Type=0&SessionId=", this.SessionId));
                 }
                 else if ((this.Afiliado.AF_DiasPassword == 0 ? false : DateAndTime.DateDiff(DateInterval.Day, this.Afiliado.AF_FechaPassword, DateTime.Now) >= (long)this.Afiliado.AF_DiasPassword))
                 {
                     base.Response.Redirect(string.Concat("~/pages/IB/Claves/CambioClave.aspx?sCod=20&Type=1&SessionId=", this.SessionId));
                 }
             }
             base.OnPreLoad(e);
             return;
         }
         else
         {
             this.sesionnovalida = true;
             base.Response.Redirect("~/Login.aspx?msg=5");
         }
     }
     else
     {
         base.OnPreLoad(e);
         return;
     }
 }