protected void Page_Load(object sender, EventArgs e) { //Se obtienen los datos de la obra int id = int.Parse((string)Request["i"]); bdsTableAdapters.c_obrasTableAdapter c_obrasTA = new bdsTableAdapters.c_obrasTableAdapter(); bds.c_obrasDataTable c_obrasTB = c_obrasTA.GetxID(id); foreach (var item in c_obrasTB) { txtNoOfico.Text = (string)item["idoficio"]; txtFecha.Text = ((DateTime)item["fecha"]).ToShortDateString(); txtNombre.Text = (string)item["nombre_obra"]; } }
protected void Page_Load(object sender, EventArgs e) { //se Obtiene si se registra el parametro de vista = r (solo lectura) string v = ""; string s = ""; try { v = (string)Request["v"]; s = (string)Request["s"]; } catch { v = ""; } if (v == "r") { //se visualiza la supervisión bdsTableAdapters.c_supcomTableAdapter supTA = new bdsTableAdapters.c_supcomTableAdapter(); bds.c_supcomDataTable supTB = supTA.GetDataByIDSup(int.Parse(s)); foreach (var item in supTB) { txtFSup.Text = ((DateTime)item["fecha"]).ToShortDateString(); txtFSup.Enabled = false; txtObs.Text = (string)item["observaciones"]; txtObs.Enabled = false; } bdsTableAdapters.c_filesupTableAdapter fTA = new bdsTableAdapters.c_filesupTableAdapter(); bds.c_filesupDataTable fTB = fTA.GetDataBySup(int.Parse(s)); gvAnexos.DataSource = fTB; gvAnexos.DataBind(); } else { validaNivel(1); //Depto. Comercial } //Se obtienen los datos de la obra int id = int.Parse((string)Request["i"]); bdsTableAdapters.c_obrasTableAdapter c_obrasTA = new bdsTableAdapters.c_obrasTableAdapter(); bds.c_obrasDataTable c_obrasTB = c_obrasTA.GetxID(id); foreach (var item in c_obrasTB) { txtNoOfico.Text = (string)item["idoficio"]; txtFecha.Text = ((DateTime)item["fecha"]).ToShortDateString(); txtNombre.Text = (string)item["nombre_obra"]; } }
private void cargaDatos(int idobra) { bdsTableAdapters.c_obrasTableAdapter obrasTA = new bdsTableAdapters.c_obrasTableAdapter(); bds.c_obrasDataTable obrasTB = obrasTA.GetxID(idobra); foreach (var item in obrasTB) { txtNoOfico.Text = (string)item["idoficio"]; txtFecha.Text = ((DateTime)item["fecha"]).ToShortDateString(); txtNameO.Text = (string)item["nombre_obra"]; txtDir.Text = (string)item["direccion"]; ddlAg.SelectedValue = (string)item["centro"]; ddlMpio.SelectedValue = (string)item["cve_mpio"]; txtObservaciones.Text = item["observaciones"] == System.DBNull.Value ? "" : (string)item["observaciones"]; // <a href='capSup.aspx?i=<%# Eval("idobra") %>&' title="Supervisión"><i class="fa fa-user-secret fa-lg"></i></a> lblFile.Text = (item["oficio"]) == System.DBNull.Value ? "" : @"< a href = '" + ((string)item["oficio"]) + "' title = 'Supervisión' >< i class='fa fa-file-pdf-o fa-lg'></i></a>"; } bloqueaCaptura(); }