Esempio n. 1
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");
        }
Esempio n. 2
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");
        }