Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserIsValid"] != null)
            {
                if (!(bool)Session["UserIsValid"])
                {
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    if (!Page.IsPostBack)
                    {
                        Customer cst = new Customer();
                        DataTable dt = new DataTable();

                        if (Request.QueryString["id"] != null)
                            dt = cst.GetCustomerByID(Int32.Parse(Request.QueryString["id"]));

                        txtNome.Text = dt.Rows[0].ItemArray[1].ToString();
                        txtTel.Text = dt.Rows[0].ItemArray[2].ToString();
                        txtEnd.Text = dt.Rows[0].ItemArray[3].ToString();
                        txtBairro.Text = dt.Rows[0].ItemArray[4].ToString();
                        txtNum.Text = dt.Rows[0].ItemArray[5].ToString();
                        txtComp.Text = dt.Rows[0].ItemArray[6].ToString();
                        txtObs.Text = dt.Rows[0].ItemArray[7].ToString();
                    }
                }
            }
            else
                Response.Redirect("Login.aspx");
        }
Esempio n. 2
0
        protected void Timer_Tick(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(msgContent))
            {
                Data.Model.Customer cst = new Data.Model.Customer();
                DataTable dt = new DataTable();

                dt = cst.GetCustomerByNumber(msgContent);

                if (dt != null)
                {
                    if (dt.Rows.Count > 0)
                        lbl.Text = "cst=" + dt.Rows[0].ItemArray[0].ToString() + "&" + "nome=" + dt.Rows[0].ItemArray[1].ToString() + "&" +
                                   "tel=" + dt.Rows[0].ItemArray[2].ToString() + "&" + "end=" + dt.Rows[0].ItemArray[3].ToString() + "&" +
                                   "barr=" + dt.Rows[0].ItemArray[4].ToString() + "&" + "num=" + dt.Rows[0].ItemArray[5].ToString() + "&" +
                                   "comp=" + dt.Rows[0].ItemArray[6].ToString() + "&" + "obs=" + dt.Rows[0].ItemArray[7].ToString();
                    else
                        lbl.Text = "new " + msgContent;

                    msgContent = "";
                }
            }
            else
                lbl.Text = "";

        }
Esempio n. 3
0
        protected void btGravar_Click(object sender, EventArgs e)
        {
            Customer cst = new Customer();

            cst.Nome = txtNome.Text;
            cst.Telefone = txtTel.Text;
            cst.Endereco = txtEnd.Text;
            cst.Bairro = txtBairro.Text;
            cst.Numero = int.Parse(txtNum.Text);
            cst.Complemento = txtComp.Text;
            cst.Obs = txtObs.Text;

            cst.AddCustomer();

            DataTable dt = new DataTable();
            dt = cst.GetCustomerByNumber(txtTel.Text);

            if (dt != null)
            {
                if (dt.Rows.Count > 0) 
                {
                    Session["NewCustomerHandler"] = dt.Rows[0].ItemArray[0].ToString();
                }
            }

            Page.ClientScript.RegisterStartupScript(this.GetType(), "CloseScript", "window.close()", true);
        }
        protected void btPesquisa_Click(object sender, EventArgs e)
        {
            GridView1.Visible = true;

            Customer cst = new Customer();
            GridView1.DataSource = cst.GetCustomerByName(txtPesquisa.Text);
            GridView1.DataBind();
        }
Esempio n. 5
0
        protected void btGravar_Click(object sender, EventArgs e)
        {
            Customer cst = new Customer();

            string id = Request.QueryString["id"];
            string tel = txtTel.Text;
            string nome = txtNome.Text;
            string end = txtEnd.Text;
            string bairro = txtBairro.Text;
            string num = txtNum.Text;
            string comp = txtComp.Text;
            string obs = txtObs.Text;

            cst.EditCustomer(id, tel, nome, end, bairro, num, comp, obs);

            Page.ClientScript.RegisterStartupScript(GetType(), "close", "window.close();", true);
        }
Esempio n. 6
0
        protected void btGravar_Click(object sender, EventArgs e)
        {
            Customer cst = new Customer();

            cst.Nome = txtNome.Text;
            cst.Telefone = txtTel.Text;
            cst.Endereco = txtEnd.Text;
            cst.Bairro = txtBairro.Text;
            cst.Numero = int.Parse(txtNum.Text);
            cst.Complemento = txtComp.Text;
            cst.Obs = txtObs.Text;

            cst.AddCustomer();

            txtNome.Text = "";
            txtTel.Text = "";
            txtEnd.Text = "";
            txtBairro.Text = "";
            txtNum.Text = "";
            txtComp.Text = "";
            txtObs.Text = "";
            lblStatus.Text = "Cadastrado com sucesso !";
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Session["UserIsValid"] != null)
            {
                if (!(bool)Session["UserIsValid"])
                {
                    Response.Redirect("Login.aspx");
                }
                else
                {
                    if (!Page.IsPostBack)
                    {
                        #region Populate dropdowns
                        Pizzaria.Data.Model.Order or = new Pizzaria.Data.Model.Order();
                        or.PopulateDropDowns(DropDownListSabor1, DropDownListQuant1);
                        or.PopulateDropDowns(DropDownListSabor2, DropDownListQuant2);
                        or.PopulateDropDowns(DropDownListSabor3, DropDownListQuant3);
                        or.PopulateDropDowns(DropDownListSabor4, DropDownListQuant4);
                        or.PopulateDropDowns(DropDownListSabor5, DropDownListQuant5);
                        or.PopulateDropDowns(DropDownListSabor6, DropDownListQuant6);
                        or.PopulateDropDowns(DropDownListSabor7, DropDownListQuant7);
                        or.PopulateDropDowns(DropDownListSabor8, DropDownListQuant8);
                        #endregion

                        Customer cst = new Customer();
                        DataTable dt = new DataTable();

                        if (Request.QueryString["id"] != null)
                        {
                            dt = cst.GetCustomerByID(Int32.Parse(Request.QueryString["id"]));

                            lblNome.Text = dt.Rows[0].ItemArray[1].ToString();
                            lblTel.Text = dt.Rows[0].ItemArray[2].ToString();
                            lblBarr.Text = dt.Rows[0].ItemArray[3].ToString();
                            lblEnd.Text = dt.Rows[0].ItemArray[4].ToString();
                            lblNum.Text = dt.Rows[0].ItemArray[5].ToString();
                            lblComp.Text = dt.Rows[0].ItemArray[6].ToString();
                        }
                    }

                    if (Session["FoundCustomerHandler"] != null)
                    {
                        string param = Session["FoundCustomerHandler"].ToString();
                        Session["FoundCustomerHandler"] = null;
                        Thread.Sleep(500);
                        Response.Redirect("Order.aspx?id=" + param);
                    }

                    if (Session["NewCustomerHandler"] != null)
                    {
                        string param = Session["NewCustomerHandler"].ToString();
                        Session["NewCustomerHandler"] = null;
                        Thread.Sleep(500);
                        Response.Redirect("Order.aspx?id=" + param);
                    }
                }
            }
            else
                Response.Redirect("Login.aspx");

        }