protected void BtnNuevo_Click1(object sender, ImageClickEventArgs e) { //txtFechaCompra.Text = DateTime.Parse("2017-01-31").ToString("yyyy-MM-dd"); //último cambio //txtFechaFin.Text = DateTime.Parse("2017-01-31").ToString("yyyy-MM-dd"); DateTime fecha = DateTime.Now; txtFechaCompra.Text = (fecha.ToString("yyyy-MM-dd")); txtFechaFin.Text = (fecha.ToString("yyyy-MM-dd")); //txtFechaFin.Text = (fecha.ToString("yyyy-MM-dd")); //txtTiempo.Text = "0"; limpiar(); BtnGraba.Enabled = true; lblgrabar.Enabled = true; txtRuc.Enabled = true; txtFechaCompra.Enabled = true; //no estoy segura ver txtTiempo.Enabled = true; txtNroFactura.Enabled = true; BtnGraba.Visible = true; lblgrabar.Visible = true; BtnModificar.Visible = false; txtUsu.Enabled = true; txtModelo.Enabled = true; txtSerie.Enabled = true; txtMarca.Enabled = true; Habilitar(); //Listar Sede DDLSede.DataTextField = "Descripcion"; DDLSede.DataValueField = "IdSede"; DDLSede.DataSource = ObjSede.ListarSede("mantenimiento"); DDLSede.DataBind(); DDLSede.Items.Insert(0, " ----------------- Seleccione ----------------- "); }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { CategoriaN objN = new CategoriaN(); CondicionN ObjCon = new CondicionN(); if (!String.IsNullOrEmpty(this.Request.QueryString["cod"])) { var cod = this.Request.QueryString["cod"]; TxtCodigo.Text = cod; } DateTime fecha = DateTime.Now; //DDLCategoria.DataTextField = "Descripcion"; //DDLCategoria.DataValueField = "IdCategoria"; //DDLCategoria.DataSource = objN.ListarCategoria(); //DDLCategoria.DataBind(); //DDLCategoria.Items.Insert(0, " ----------------- Seleccione ----------------- "); //Listar Sede DDLSede.DataTextField = "Descripcion"; DDLSede.DataValueField = "IdSede"; DDLSede.DataSource = ObjSede.ListarSede("mantenimiento"); DDLSede.DataBind(); DDLSede.Items.Insert(0, " ----------------- Seleccione ----------------- "); TxtCodigo.Focus(); columnasGrid(); } else { dt = (DataTable)ViewState["dt"]; } } catch (Exception ex) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('" + ex.Message + "');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { CategoriaN objN = new CategoriaN(); CondicionN ObjCon = new CondicionN(); if (!String.IsNullOrEmpty(this.Request.QueryString["cod"])) { var cod = this.Request.QueryString["cod"]; TxtCodigo.Text = cod; } //if (Session["Perfil"] == null) //{ // return; //} //if (int.Parse(Session["Perfil"].ToString()) == 3) // si es perfil vigilancia //{ // this.Page.Response.Write("<script language ='JavaScript'>window.alert('<<Acceso Denegado>>');</script>"); // Response.Redirect("~/login.aspx"); //} // DateTime fecha = DateTime.Now; //TxtFecha.Text = fecha.ToShortDateString(); //Listar Categoria DDLCategoria.DataTextField = "Descripcion"; DDLCategoria.DataValueField = "IdCategoria"; DDLCategoria.DataSource = objN.ListarCategoria(); DDLCategoria.DataBind(); DDLCategoria.Items.Insert(0, " ----------------- Seleccione ----------------- "); //Listar Sede DDLSede.DataTextField = "Descripcion"; DDLSede.DataValueField = "IdSede"; DDLSede.DataSource = ObjSede.ListarSede("partida"); DDLSede.DataBind(); DDLSede.Items.Insert(0, " ----------------- Seleccione ----------------- "); TxtCodigo.Focus(); //Listar Condicion DDLCondicion.DataTextField = "Descripcion"; DDLCondicion.DataValueField = "IdCondicion"; DDLCondicion.DataSource = ObjCon.ListarCondicion(); DDLCondicion.DataBind(); //DDLCondicion.Items.Insert(0, " ----------------- Seleccione ----------------- "); Bloquear(); columnasGrid(); } else { dt = (DataTable)ViewState["dt"]; } } catch (Exception ex) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('" + ex.Message + "');</script>"); } }