Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /*
             * Op I - É incluir
             * Op A - É alterar
             */

            if (!IsPostBack)
            {
                /***********************************************************/
                abastecimento = new Abastecimento();
                abastecimento.novo();
                setSession();
                /***********************************************************/
                listaCombustivel();
                ddCombustivel.Items.Add(new ListItem("Selecione", "0", true));
                ddCombustivel.Items.FindByValue("0").Selected = true;
                /***********************************************************/
                listaPosto();
                ddPosto.Items.Add(new ListItem("Selecione", "0", true));
                ddPosto.Items.FindByValue("0").Selected = true;
                /***********************************************************/
                if (Request.QueryString["op"] == "A")
                {
                    daoAbastecimento = new DAOAbastecimento(arquivo);
                    abastecimento.ID = Int32.Parse(Request.QueryString["id"]);
                    daoAbastecimento.buscarID(abastecimento);
                    getDados();
                    abastecimento.editar();
                    setSession();
                }
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            /*
             * Op I - É incluir
             * Op A - É alterar
             */

            if (!IsPostBack)
            {
                /***********************************************************/
                abastecimento = new Abastecimento();
                abastecimento.novo();
                setSession();
                /***********************************************************/
                listaCombustivel();
                ddCombustivel.Items.Add(new ListItem("Selecione", "0", true));
                ddCombustivel.Items.FindByValue("0").Selected = true;
                /***********************************************************/
                listaPosto();
                ddPosto.Items.Add(new ListItem("Selecione", "0", true));
                ddPosto.Items.FindByValue("0").Selected = true;
                /***********************************************************/
                if (Request.QueryString["op"] == "A")
                {
                    daoAbastecimento = new DAOAbastecimento(arquivo);
                    abastecimento.ID = Int32.Parse(Request.QueryString["id"]);
                    daoAbastecimento.buscarID(abastecimento);
                    getDados();
                    abastecimento.editar();
                    setSession();
                }
            }
        }