Exemple #1
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            if (!(String.IsNullOrEmpty(txtMotivo.Text)))
            {
                tbl_incidentTableAdapter incident = new tbl_incidentTableAdapter();
                tbl_bitacoraTableAdapter bitac    = new tbl_bitacoraTableAdapter();
                int folio = Convert.ToInt32(Request.QueryString["folio"]);
                incident.updateApprove(8, folio);
                bitac.Insert(DateTime.Now, "solicitud rechazada", "Motivo: " + txtMotivo.Text, "incidenteAccidente", folio, 0, Convert.ToString(Session["userName"]));
                bitac.Dispose();
                incident.Dispose();
                try
                {
                    enviarCorreoRecha(Convert.ToInt32(Request.QueryString["folio"]), txtMotivo.Text);
                }
                catch (Exception ex)
                {
                    lblError.Text = ex.Message;
                }

                Response.Redirect("my-reports.aspx");
            }
            else
            {
            }
        }
Exemple #2
0
        protected void btnEnviarMotivo_Click(object sender, EventArgs e)
        {
            if (!(String.IsNullOrEmpty(TextBox4.Text)))
            {
                tbl_incidentTableAdapter   incident = new tbl_incidentTableAdapter();
                tbl_actionPlanTableAdapter acPlan   = new tbl_actionPlanTableAdapter();
                tbl_bitacoraTableAdapter   bitac    = new tbl_bitacoraTableAdapter();
                int folio = Convert.ToInt32(Request.QueryString["folio"]);
                acPlan.updateStatus(10, Convert.ToInt32(txt_folio0.Text));
                bitac.Insert(DateTime.Now, "plan de acción rechazado", "Motivo: " + TextBox4.Text, "planAccion", folio, 0, Convert.ToString(Session["userName"]));
                bitac.Dispose();
                incident.updateApprove(10, folio);
                incident.Dispose();
                try
                {
                    enviarCorreoRecha(Convert.ToInt32(Request.QueryString["folio"]), txtMotivo.Text);
                }
                catch (Exception ex)
                {
                    lblError.Text = ex.Message;
                }

                Response.Redirect("dash-incidentes.aspx");
            }
            else
            {
            }
        }
Exemple #3
0
        protected void btnAceptar_Click(object sender, EventArgs e)
        {
            tbl_incidentTableAdapter incident = new tbl_incidentTableAdapter();
            tbl_bitacoraTableAdapter bitac    = new tbl_bitacoraTableAdapter();
            int folio = Convert.ToInt32(Request.QueryString["folio"]);

            incident.updateApprove(7, folio);
            bitac.Insert(DateTime.Now, "solicitud aprobada", "", "incidentAccident", folio, 0, Convert.ToString(Session["userName"]));
            bitac.Dispose();
            incident.Dispose();
            enviarCorreo(Convert.ToInt32(Request.QueryString["folio"]));
            Response.Redirect("my-reports.aspx");
        }
Exemple #4
0
        protected void btnAceptar0_Click(object sender, EventArgs e)
        {
            tbl_actionPlanTableAdapter acPlan   = new tbl_actionPlanTableAdapter();
            tbl_incidentTableAdapter   incident = new tbl_incidentTableAdapter();
            tbl_bitacoraTableAdapter   bitac    = new tbl_bitacoraTableAdapter();
            int folio      = Convert.ToInt32(Request.QueryString["folio"]);
            int actionPlan = Convert.ToInt32(txt_folio0.Text);

            acPlan.updateStatus(11, Convert.ToInt32(txt_folio0.Text));
            bitac.Insert(DateTime.Now, "plan de acción validado", "", "planAcción", folio, actionPlan, Convert.ToString(Session["userName"]));
            bitac.Dispose();
            incident.updateApprove(11, folio);
            incident.Dispose();
            acPlan.Dispose();
            correoSHEupdate(Convert.ToInt32(Request.QueryString["folio"]));
            Response.Redirect("dash-incidentes.aspx");
        }
Exemple #5
0
        private void generaActualizaReporte()
        {
            if (grvPersonEvent.EditIndex != -1)
            {
                //lblError.Text ="Sorre";
            }
            //creamos la instancia para la tabla extraida del dataset XSD
            tbl_incidentTableAdapter incidentes = new tbl_incidentTableAdapter();

            if (grvPersonEvent.Rows.Count > 0 && grvInmedActions.Rows.Count > 0)
            {
                btn_reporte.Enabled = true;

                try
                {
                    lbl_errAction.Visible  = false;
                    lbl_errPersona.Visible = false;
                    string   descriptEvento     = txt_eventDesc.Text;
                    DateTime fechaEvento        = Convert.ToDateTime(txt_eventFecha.Text);
                    int      turnoEvento        = Convert.ToInt32(ddl_turno.SelectedValue);
                    int      areaEvento         = Convert.ToInt32(ddl_eventArea.SelectedValue);
                    int      tipoEvento         = Convert.ToInt32(ddlEvents2.SelectedValue);
                    int      placeEvento        = Convert.ToInt32(ddl_eventPlace.SelectedValue);
                    int      tipoEventoHijo     = 0;
                    int      gec                = 0;
                    int      tipoEventoHijoHijo = 0;
                    decimal  serie              = Convert.ToDecimal(generateSerial());
                    //string a = System.Configuration.ConfigurationManager.ConnectionStrings["WingtipToys"].ConnectionString;
                    if (!(DropDownList2.Visible == false || ddlEvCh.SelectedValue == ""))
                    {
                        tipoEventoHijo = Convert.ToInt32(DropDownList2.SelectedValue);
                    }
                    if (!(ddlEvChCh.Visible == false || ddlEvCh.SelectedValue == ""))
                    {
                        tipoEventoHijoHijo = Convert.ToInt32(ddlEvCh.SelectedValue);
                    }
                    if (RadioButtonList1.SelectedIndex == -1)
                    {
                        gec = 0;
                    }
                    else
                    {
                        gec = Convert.ToInt32(RadioButtonList1.SelectedValue);
                    }
                    //mail(0, ddl_eventArea.SelectedItem.Text, ddl_eventClasif.SelectedItem.Text, txt_eventDesc.Text, txt_eventFecha.Text, "Revisión", Session["userName"].ToString(), 5);
                    if ((txt_folio.Text == "0") || txt_folio.Text == "")
                    {
                        //metodo para insertar la información. De momento se toma todo tal cual de los campos
                        int resIncident = incidentes.Insert(descriptEvento, fechaEvento, turnoEvento,
                                                            areaEvento, tipoEvento, tipoEventoHijo, 0, placeEvento,
                                                            serie, 6, gec, Convert.ToInt32(ddl_eventClasif.SelectedValue), Convert.ToInt32(Session["userID"]), DateTime.Now, TimeSpan.Parse(txt_eventHora.Text), Convert.ToString(Session["userName"]));

                        int incid_id = Convert.ToInt32(incidentes.getIncidentIDBySerial(serie));

                        tbl_personEventTableAdapter employeeEvent = new tbl_personEventTableAdapter();
                        int resEmploy = employeeEvent.UpdateIncidID(incid_id, Convert.ToString(Session["userName"]));
                        //employeeEvent.DeleteTempQuery(Convert.ToString(Session["userName"]), incid_id);
                        tbl_inmediateActionTableAdapter actions = new tbl_inmediateActionTableAdapter();
                        int resActions = actions.UpdateIncidID(incid_id, Convert.ToString(Session["userName"]));
                        //actions.DeleteTempQuery(Convert.ToString(Session["userName"]), incid_id);
                        tbl_bitacoraTableAdapter bitac = new tbl_bitacoraTableAdapter();
                        bitac.Insert(DateTime.Now, "reporte creado", "", "incidenteAccidente", incid_id, 0, Convert.ToString(Session["userName"]));
                        bitac.Dispose();
                        //apartado de parametros que conforman el correo electrónico que se despliega
                        //******Descmentar para el servicio de correo electrónico********
                        //mail(incid_id, ddl_eventArea.SelectedItem.Text, ddl_eventClasif.SelectedItem.Text, txt_eventDesc.Text, txt_eventFecha.Text, "Revisión", Session["userName"].ToString(), Convert.ToInt32( ddl_eventArea.SelectedValue));
                        //enviarCorreo(incid_id);
                        //****** fin de correo electronico ****
                        lbl_reportNum.Text = incid_id.ToString();
                    }
                    else
                    {
                        int folio       = Convert.ToInt32(txt_folio.Text);
                        int resIncident = incidentes.Update(descriptEvento, fechaEvento, turnoEvento, areaEvento,
                                                            tipoEvento, tipoEventoHijo, 0, placeEvento, serie, 6, gec, Convert.ToInt32(ddl_eventClasif.SelectedValue),
                                                            Convert.ToInt32(Session["userID"]), Convert.ToDateTime(lblFechaReporte.Text), TimeSpan.Parse(txt_evHora.Text), Convert.ToString(Session["userName"]), folio);
                        mail(folio, ddl_eventArea.SelectedItem.Text, ddl_eventClasif.SelectedItem.Text, txt_eventDesc.Text, txt_eventFecha.Text, "Revisión", Session["userName"].ToString(), Convert.ToInt32(ddl_eventArea.SelectedValue));
                        //correoUpdateReport(folio);
                        tbl_bitacoraTableAdapter bitac = new tbl_bitacoraTableAdapter();
                        bitac.Insert(DateTime.Now, "Actualización de reporte", "", "incidenteAccidente", folio, 0, Convert.ToString(Session["userName"]));
                        bitac.Dispose();
                        Response.Redirect("my-reports.aspx");
                    }
                    hdf_ok_ModalPopupExtender.Show();
                    //una vez generado el registro de incidente vamos a buscar el ID para relacionar empleados y acciones inmediatas
                    //int incid_id = Convert.ToInt32(incidentes.GetIDByFolio(Convert.ToInt32(serie)).Rows[0][0]);
                }
                catch (Exception ex)
                {
                    lblError.Text = ex.Message;
                    incidentes.Dispose();
                }
            }
            else
            {
                //Label20.Text = "Es necesario agregar acciones y los involucrados";
                // HttpContext.Current.Response.Write("Es necesario agregar acciones y los involucrados");
                if (grvPersonEvent.Rows.Count == 0)
                {
                    lbl_errPersona.Visible = true;
                }
                else if (grv_acciones.Rows.Count == 0)
                {
                    lbl_errAction.Visible = true;
                }
            }
        }