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"); }
protected void btn_save_Click(object sender, EventArgs e) { tbl_eventActionsTableAdapter Actions = new tbl_eventActionsTableAdapter(); int actType = Convert.ToInt32(ddl_actType.SelectedValue); int ctrlType = Convert.ToInt32(ddl_ctrlType.SelectedValue); DateTime fechaComp = Convert.ToDateTime(txt_fechaComp.Text); int folio = Convert.ToInt32(txt_folio.Text); int resp = Convert.ToInt32(ddl_resp.SelectedValue); int actionPlanID = Convert.ToInt32(txt_folio0.Text); Actions.Insert(actType, txt_acciones.Text, ctrlType, resp, fechaComp, null, "", 5, folio, actionPlanID); Actions.Dispose(); grv_acciones.DataBind(); }
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"); }
protected void btn_save_Click(object sender, EventArgs e) { tbl_eventActionsTableAdapter Actions = new tbl_eventActionsTableAdapter(); int actType = Convert.ToInt32(ddl_actType.SelectedValue); int ctrlType = Convert.ToInt32(ddl_ctrlType.SelectedValue); DateTime fechaComp = Convert.ToDateTime(txt_fechaComp.Text); int folio = Convert.ToInt32(vosID.Text); int resp = Convert.ToInt32(ddl_resp.SelectedValue); int actionPlanID = Convert.ToInt32(AcPlan.Text); Actions.Insert(actType, txt_acciones.Text, ctrlType, resp, fechaComp, null, "", 5, folio, actionPlanID); //SqlDataSource2.SelectParameters["ActPlan"].DefaultValue = AcPlan.Text; Response.Write("<script>alert('Guardado Correctamente');</script>"); Panel1.Visible = false; ddl_actType.SelectedValue = "0"; ddl_ctrlType.SelectedValue = "0"; txt_fechaComp.Text = ""; ddl_resp.SelectedValue = "0"; txt_acciones.Text = ""; }