Exemple #1
0
        protected void btn_end_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (GridViewRow row in grv_inspectDtl.Rows)
                {
                    string      obs         = "";
                    RadioButton rdb_cumple  = row.FindControl("rdb_cumple") as RadioButton;
                    RadioButton rdb_na      = row.FindControl("rdb_na") as RadioButton;
                    TextBox     txtObs      = row.FindControl("txt_evidencia") as TextBox;
                    TextBox     txtFile     = row.FindControl("txt_file") as TextBox;
                    Label       lblAspect   = (Label)row.FindControl("Label2");
                    HyperLink   hpl         = (HyperLink)row.FindControl("hpl_evidencia");
                    GridViewRow rowSelected = (GridViewRow)rdb_cumple.NamingContainer;
                    if (txtObs == null)
                    {
                        obs = "";
                    }
                    else
                    {
                        obs = txtObs.Text;
                    }
                    if (!rdb_na.Checked)
                    {
                        if (rdb_cumple.Checked)
                        {
                            //lblError.Text = "OK! se puede utilizar para evitar errores";
                            bd.insrInspectDtl(Session["inspectID"].ToString(), lblAspect.Text, "1", obs, hpl.Text, ConnectionString);
                        }
                        else
                        {
                            bd.insrInspectDtl(Session["inspectID"].ToString(), lblAspect.Text, "0", obs, hpl.Text, ConnectionString);
                        }
                    }
                }
                string horaFecha = DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss");
                //*** actualizar la hora de fin de la inspección
                bd.updateInspectHead(horaFecha, Session["inspectID"].ToString(), ConnectionString);
                //*** actulizar el programa para cerrar esta inspección
                bd.updateProgramInspect(horaFecha, Request.QueryString["pID"], ConnectionString);

                string actPl = bd.generaActionPlan(Convert.ToString(Session["inspectID"]), 7, ConnectionString);
                //*** generamos el registro en la bitacora
                bd.insertBitacora(horaFecha, "Inspección finalizada", "", "inspects", Session["inspectID"].ToString(), actPl, Session["userName"].ToString(), "0", ConnectionString);
                //Generar las acciones para los elementos no satisfactorios
                //bd.generaAcciones(Convert.ToString(Session["inspectID"]), actPl, ConnectionString);
                Response.Redirect("dash-inspect.aspx");
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
        }
Exemple #2
0
        protected void btn_save_Click(object sender, EventArgs e)
        {
            try
            {
                string areaId = Session["Area"].ToString();
                string proc   = ddl_proc.SelectedValue;
                string viewer = Session["userID"].ToString();
                string date   = txt_fecha.Text;
                string place  = txt_place.Text;


                string vId  = bd.insrVos(areaId, viewer, date, proc, place, ConnectionString);
                string temp = bd.generaActionPlan(vId, 14, ConnectionString);
                foreach (GridViewRow row in grv_vos.Rows)
                {
                    RadioButtonList rdb_obs = row.FindControl("SI1") as RadioButtonList;
                    string          Retro   = rdb_obs.SelectedValue;

                    RadioButtonList observacion = row.FindControl("OBS1") as RadioButtonList;
                    string          valObs      = observacion.SelectedValue;
                    //if (test == "SI")
                    //{
                    //    test = "1";
                    //}
                    //else {
                    //    test = "0";
                    //}
                    TextBox Coment         = row.FindControl("Comentario1") as TextBox;
                    string  comentarios    = Coment.Text;
                    Label   noPregunta     = row.FindControl("L1") as Label;
                    string  preguntaNumero = noPregunta.Text;


                    bd.insrVosDtl(vId, preguntaNumero, valObs, Retro, comentarios, ConnectionString);
                }
                //bd.insrVos(areaId,viewer,date,proc,place,ConnectionString);
                Response.Redirect("dash-vos.aspx");
                //Response.Redirect("login.aspx?pag=vos");
            }
            catch (Exception ex)
            {
            }
        }