Esempio n. 1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Finalizar")
                {
                    int codigo;
                    DAL.DALClassConsultas aDALClassConsultas;
                    int index = Convert.ToInt32(e.CommandArgument);
                    codigo             = Convert.ToInt32(GridView1.Rows[index].Cells[0].Text);
                    aDALClassConsultas = new DAL.DALClassConsultas();
                    aDALClassConsultas.UpdateDivida(codigo);

                    Response.Redirect("~\\WebFormCRUDVendas.aspx");
                }

                if (e.CommandName == "Detalhar")
                {
                    string codigo;
                    int    index = Convert.ToInt32(e.CommandArgument);
                    codigo           = GridView1.Rows[index].Cells[0].Text;
                    Session["id_de"] = codigo;
                    Response.Redirect("~\\WebFormCRUDDetalheVendaEdit.aspx");
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "none", "ErroTamanhoExagerado()", true);
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DAL.DALClassConsultas aDALClassConsultas;

            if ((Session["log_in"] != null) && (Session["log_in"].ToString() != ""))
            {
                aDALClassConsultas = new DAL.DALClassConsultas();
                string nomelogin = aDALClassConsultas.SelectLogin(Session["log_in"].ToString()).Tables[0].Rows[0][0].ToString();
                LabelBoasVindas.Text = "<h1>Bem Vindo, " + nomelogin + "</h1>";
            }
            else
            {
                Response.Redirect("WebFormLogin.aspx");
            }
        }