示例#1
0
        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"];
            }
        }
        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"];
            }
        }