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 = "";

        }
        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);
        }