Ejemplo n.º 1
0
 protected void LinkButton1_Click(object sender, EventArgs e)
 {
     //se almacenan los datos de la supervision
     //1. Se almacenan los datos en la tabla de c_supcom
     int id = int.Parse((string)Request["i"]);
     string fecha = txtFSup.Text;
     string obs = txtObs.Text;
     string rpe = (string)Session["rpe"];
     bdsTableAdapters.c_supcomTableAdapter supTA = new bdsTableAdapters.c_supcomTableAdapter();
     supTA.InsertQuery(id, DateTime.Parse(fecha), obs, rpe);
     //
     bds.c_supcomDataTable supTB = supTA.GetDataxSup(id, obs, rpe);
     int idsup = 0;
     foreach (var item in supTB) {
         idsup = (int)item["idsup"];
     }
     //3. Si se inserto la supervision entonces se guardan los anexos de los archivos temporales
     bdsTableAdapters.c_filetmpTableAdapter ftmpTA = new bdsTableAdapters.c_filetmpTableAdapter();
     bdsTableAdapters.c_filesupTableAdapter fsupTA = new bdsTableAdapters.c_filesupTableAdapter();
     bds.c_filetmpDataTable tmp = ftmpTA.GetDataxSup(Session.SessionID);
     foreach (var item in tmp) {
         fsupTA.InsertQuery(idsup, (string)item["filepath"], (string)item["titulo"]);
     }
     //se borran los archivos temporales
     ftmpTA.DeleteQuerySup(Session.SessionID);
     //se actualiza el status de la obra a Supervisada
     bdsTableAdapters.c_obrasTableAdapter c_obrasTA = new bdsTableAdapters.c_obrasTableAdapter();
     c_obrasTA.ActualizaStatus(1, id);
     BootStrapAlert alerta = new BootStrapAlert();
     lblMsg.Text = alerta.GeneraAlerta("Se guardo correctamente la Supervisión de la Obra.  &nbsp;&nbsp;<a  href='principal.aspx' class='btn btn-info btn-xs'><i class='fa fa-check-circle'></i> Continuar </a>", "info");
 }
Ejemplo n.º 2
0
 protected void addFile_Click(object sender, EventArgs e)
 {
     //Se guardan en una tabla temporal los anexos de la supervision
     string filename = fuAnexo.FileName;
     string path = Server.MapPath("anexos");
     string newName = Session.SessionID + "_" + filename;
     path += "\\" + newName;
     bdsTableAdapters.c_filetmpTableAdapter ftmpTA = new bdsTableAdapters.c_filetmpTableAdapter();
     ftmpTA.InsertQuery(Session.SessionID, newName, filename);
     fuAnexo.SaveAs(path);
     bds.c_filetmpDataTable tmp = ftmpTA.GetDataxSup(Session.SessionID);
     gvAnexos.DataSource = tmp;
     gvAnexos.DataBind();
 }
Ejemplo n.º 3
0
        protected void addFile_Click(object sender, EventArgs e)
        {
            //Se guardan en una tabla temporal los anexos de la supervision
            string filename = fuAnexo.FileName;
            string path     = Server.MapPath("anexos");
            string newName  = Session.SessionID + "_" + filename;

            path += "\\" + newName;
            bdsTableAdapters.c_filetmpTableAdapter ftmpTA = new bdsTableAdapters.c_filetmpTableAdapter();
            ftmpTA.InsertQuery(Session.SessionID, newName, filename);
            fuAnexo.SaveAs(path);
            bds.c_filetmpDataTable tmp = ftmpTA.GetDataxSup(Session.SessionID);
            gvAnexos.DataSource = tmp;
            gvAnexos.DataBind();
        }
Ejemplo n.º 4
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            //se almacenan los datos de la supervision
            //1. Se almacenan los datos en la tabla de c_supcom
            int    id    = int.Parse((string)Request["i"]);
            string fecha = txtFSup.Text;
            string obs   = txtObs.Text;
            string rpe   = (string)Session["rpe"];

            bdsTableAdapters.c_supcomTableAdapter supTA = new bdsTableAdapters.c_supcomTableAdapter();
            supTA.InsertQuery(id, DateTime.Parse(fecha), obs, rpe);
            //
            bds.c_supcomDataTable supTB = supTA.GetDataxSup(id, obs, rpe);
            int idsup = 0;

            foreach (var item in supTB)
            {
                idsup = (int)item["idsup"];
            }
            //3. Si se inserto la supervision entonces se guardan los anexos de los archivos temporales
            bdsTableAdapters.c_filetmpTableAdapter ftmpTA = new bdsTableAdapters.c_filetmpTableAdapter();
            bdsTableAdapters.c_filesupTableAdapter fsupTA = new bdsTableAdapters.c_filesupTableAdapter();
            bds.c_filetmpDataTable tmp = ftmpTA.GetDataxSup(Session.SessionID);
            foreach (var item in tmp)
            {
                fsupTA.InsertQuery(idsup, (string)item["filepath"], (string)item["titulo"]);
            }
            //se borran los archivos temporales
            ftmpTA.DeleteQuerySup(Session.SessionID);
            //se actualiza el status de la obra a Supervisada
            bdsTableAdapters.c_obrasTableAdapter c_obrasTA = new bdsTableAdapters.c_obrasTableAdapter();
            c_obrasTA.ActualizaStatus(1, id);
            BootStrapAlert alerta = new BootStrapAlert();

            lblMsg.Text = alerta.GeneraAlerta("Se guardo correctamente la Supervisión de la Obra.  &nbsp;&nbsp;<a  href='principal.aspx' class='btn btn-info btn-xs'><i class='fa fa-check-circle'></i> Continuar </a>", "info");
        }