Ejemplo n.º 1
0
        protected void cmdOK_Click(object sender, EventArgs e)
        {
            try
            {
                int vid = Convert.ToInt32(ViewState["vid"]);

                SalitaEntities db = new SalitaEntities();

                var V = db.Visits.Single(p => p.Visit_ID == vid);

                V.Mood = ViewState["m"].ToString();

                db.SaveChanges();

                UpdateHub.SendServer("");

                Response.Redirect("default.aspx");
            }
            catch (Exception E)
            {
                this.CustomValidator1.IsValid      = false;
                this.CustomValidator1.ErrorMessage = E.Message;

                if (E.InnerException != null)
                {
                    this.CustomValidator1.ErrorMessage += " InnerException: " + E.InnerException.Message;
                }
            }
        }
Ejemplo n.º 2
0
        protected void cmdOK_Click(object sender, EventArgs e)
        {
            try
            {
                int id = Convert.ToInt32(ViewState["id"]);

                this.FullfillService(id);

                UpdateHub.SendServer("");

                if (ViewState["ServiceType"].ToString() == "T")
                {
                    Response.Redirect("report_transportation.aspx");
                }
                else
                {
                    Response.Redirect("default.aspx");
                }
            }
            catch (Exception E)
            {
                this.CustomValidator1.IsValid      = false;
                this.CustomValidator1.ErrorMessage = E.Message;

                if (E.InnerException != null)
                {
                    this.CustomValidator1.ErrorMessage += " InnerException: " + E.InnerException.Message;
                }
            }
        }
Ejemplo n.º 3
0
        protected void cmdSeatInRoom_Click(object sender, EventArgs e)
        {
            try
            {
                if (ViewState["mode"].ToString() == "Add")
                {
                    Visit V = new Visit();

                    V.Customer_ID = Convert.ToInt32(ViewState["Customer_ID"]);
                    V.Seat_X      = 0;
                    V.Seat_Y      = 0;
                    V.InLounge    = true;
                    V.VisitDate   = DateTime.Now;
                    V.WaitingFor  = this.cmbWaitingFor.SelectedItem.Text;
                    V.LoginPIN    = this.txtPIN.Value;
                    V.Mood        = this.cmbMood.SelectedValue.ToString();
                    this.db.Visits.Add(V);
                    this.db.SaveChanges();

                    this.cmdSeatInRoom.Enabled = false;

                    UpdateHub.SendServer("");

                    throw new Exception("El cliente fue sentado en la <a href=\"default.aspx\">sala virtual.</a>");
                }
                else if (ViewState["mode"].ToString() == "Edit")
                {
                    int cid = Convert.ToInt32(ViewState["Customer_ID"]);

                    var V = this.db.Visits.Single(p => p.Customer_ID == cid && p.InLounge == true);

                    V.VisitDate  = DateTime.Now;
                    V.WaitingFor = this.cmbWaitingFor.SelectedItem.Text;
                    V.LoginPIN   = this.txtPIN.Value;
                    V.Mood       = this.cmbMood.SelectedValue.ToString();

                    this.db.SaveChanges();

                    throw new Exception("El cliente fue reseteado a esperar por otro servicio o a otro PIN.</a> <a href=\"default.aspx\">Ir a sala virtual.</a>");
                }
            }
            catch (Exception E)
            {
                this.CustomValidator1.IsValid      = false;
                this.CustomValidator1.ErrorMessage = E.Message;
            }
        }
Ejemplo n.º 4
0
        protected void cmdOK_Click(object sender, EventArgs e)
        {
            try
            {
                int cid = Convert.ToInt32(ViewState["Customer_ID"]);
                int sid = Convert.ToInt32(ViewState["sid"]);

                this.SetService(cid, sid);

                UpdateHub.SendServer("");

                Response.Redirect("default.aspx");
            }
            catch (Exception E)
            {
                this.CustomValidator1.IsValid      = false;
                this.CustomValidator1.ErrorMessage = E.Message;

                if (E.InnerException != null)
                {
                    this.CustomValidator1.ErrorMessage += " InnerException: " + E.InnerException.Message;
                }
            }
        }