예제 #1
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
            {
            }
        }
예제 #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            tbl_actionPlanTableAdapter   actionPlan = new tbl_actionPlanTableAdapter();
            tbl_eventActionsTableAdapter evActions  = new tbl_eventActionsTableAdapter();

            DataSet1.tbl_actionPlanDataTable dtActPlan = new DataSet1.tbl_actionPlanDataTable();

            if (txt_folio0.Text == "0")
            {
                int actPlan_id = 0;
                int inciID     = Convert.ToInt32(txt_folio.Text);
                actionPlan.Insert(0, "", false, 9, 1, inciID, 6);
                actPlan_id = Convert.ToInt32(actionPlan.getMaxActPlan());

                evActions.updateActPlan(actPlan_id, Convert.ToInt32(txt_folio.Text));

                tbl_bitacoraTableAdapter bitac = new tbl_bitacoraTableAdapter();
                bitac.Insert(Convert.ToDateTime(DateTime.Today.ToShortDateString()), "plan de acción creado", "", "investigación", Convert.ToInt32(txt_folio.Text), 0, Convert.ToString(Session["userName"]));
            }
            else
            {
                tbl_bitacoraTableAdapter bitac = new tbl_bitacoraTableAdapter();
                bitac.Insert(Convert.ToDateTime(DateTime.Today.ToShortDateString()), "se ha actualizado el plan de acción", "", "investigación", Convert.ToInt32(txt_folio.Text), 0, Convert.ToString(Session["userName"]));
            }

            actionPlan.Dispose();
            evActions.Dispose();
            dtActPlan.Dispose();
            Response.Redirect("my-reports.aspx");
        }
예제 #3
0
        private int getPlanActStatus(int actionPlan)
        {
            tbl_actionPlanTableAdapter acPlan = new tbl_actionPlanTableAdapter();
            int actPlanStatus = Convert.ToInt32(acPlan.getStatus(actionPlan));

            acPlan.Dispose();
            return(actPlanStatus);
        }
예제 #4
0
        protected void txt_folio_TextChanged(object sender, EventArgs e)
        {
            tbl_actionPlanTableAdapter acPlan = new tbl_actionPlanTableAdapter();
            int actPlanID = Convert.ToInt32(acPlan.getActIDByFolio(Convert.ToInt32(txt_folio.Text)));

            txt_folio0.Text = actPlanID.ToString();
            acPlan.Dispose();
        }
예제 #5
0
        private int getPlanAccion(int incidID)
        {
            tbl_actionPlanTableAdapter acPlan = new tbl_actionPlanTableAdapter();
            int actPlanID = Convert.ToInt32(acPlan.getActIDByFolio(incidID));

            txt_folio0.Text = actPlanID.ToString();
            acPlan.Dispose();
            return(actPlanID);
        }
예제 #6
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");
        }
예제 #7
0
        protected void btnGuardaInv_Click(object sender, EventArgs e)
        {
            tbl_actionPlanTableAdapter   actionPlan = new tbl_actionPlanTableAdapter();
            tbl_eventActionsTableAdapter evActions  = new tbl_eventActionsTableAdapter();

            DataSet1.tbl_actionPlanDataTable dtActPlan = new DataSet1.tbl_actionPlanDataTable();
            if (grv_acciones.EditIndex > -1)
            {
            }
            if (txt_folio0.Text == "0")
            {
                int actPlan_id = 0;
                int inciID     = Convert.ToInt32(txt_folio.Text);
                actPlan_id = Convert.ToInt32(actionPlan.getMaxActPlan()) + 1;
                actionPlan.Insert(actPlan_id, "", false, 9, 0, inciID, 9);
                actPlan_id = Convert.ToInt32(actionPlan.getMaxActPlan());

                evActions.updateActPlan(actPlan_id, Convert.ToInt32(txt_folio.Text));

                tbl_bitacoraTableAdapter bitac = new tbl_bitacoraTableAdapter();
                bitac.Insert(DateTime.Now, "plan de acción creado", "", "investigación", Convert.ToInt32(txt_folio.Text), 0, Convert.ToString(Session["userName"]));
                correoSHE(Convert.ToInt32(txt_folio.Text));
            }
            else
            {
                actionPlan.updateStatus(9, Convert.ToInt32(txt_folio0.Text));
                tbl_bitacoraTableAdapter bitac = new tbl_bitacoraTableAdapter();
                bitac.Insert(DateTime.Now, "se ha actualizado el plan de acción", "", "investigación", Convert.ToInt32(txt_folio.Text), 0, Convert.ToString(Session["userName"]));
                correoSHEupdate(Convert.ToInt32(txt_folio.Text));
            }
            tbl_incidentTableAdapter incident = new tbl_incidentTableAdapter();
            int folio = Convert.ToInt32(Request.QueryString["folio"]);

            incident.updateApprove(9, folio);

            actionPlan.Dispose();
            evActions.Dispose();
            dtActPlan.Dispose();
            Response.Redirect("dash-incidentes.aspx");
        }