protected void ImgEliminaGes_Click(object sender, ImageClickEventArgs e) { try { if (DdlMotivo3.SelectedValue == "0") { new FuncionesDAO().FunShowJSMessage("Seleccione Motivo..!", this); return; } if (string.IsNullOrEmpty(TxtObservacion3.Text.Trim())) { new FuncionesDAO().FunShowJSMessage("Ingrese Observación..!", this); return; } GridViewRow _gvrow = (GridViewRow)(sender as Control).Parent.Parent; _codigogete = int.Parse(GrdvGestiones.DataKeys[_gvrow.RowIndex].Values["codigoGETE"].ToString()); _identificacion = GrdvGestiones.DataKeys[_gvrow.RowIndex].Values["Identificacion"].ToString(); _operacion = GrdvGestiones.DataKeys[_gvrow.RowIndex].Values["Operacion"].ToString(); _codigogestor = int.Parse(GrdvGestiones.DataKeys[_gvrow.RowIndex].Values["codigoGESTOR"].ToString()); _descripcion = GrdvGestiones.DataKeys[_gvrow.RowIndex].Values["Descripcion"].ToString(); new ConsultaDatosDAO().FunConsultaDatos(98, _codigogete, 0, 0, "", _telefono, "", Session["Conectar"].ToString()); SoftCob_ACCIONGESTION _newaccion = new SoftCob_ACCIONGESTION(); { _newaccion.acci_tipoaccion = "ELIMINAR GESTION"; _newaccion.acci_idmotivo = int.Parse(DdlMotivo3.SelectedValue); _newaccion.acci_observacion = TxtObservacion3.Text.Trim().ToUpper(); _newaccion.acci_codigocpce = int.Parse(ViewState["codigoCPCE"].ToString()); _newaccion.acci_identificacion = _identificacion; _newaccion.acci_operacion = _operacion; _newaccion.acci_gestoranterior = _codigogestor; _newaccion.acci_gestoractual = 0; _newaccion.acci_datoanterior = _descripcion; _newaccion.acci_auxv1 = ""; _newaccion.acci_auxv2 = ""; _newaccion.acci_auxv3 = ""; _newaccion.acci_auxi1 = int.Parse(ViewState["codigoPERS"].ToString()); _newaccion.acci_auxi2 = 0; _newaccion.acci_auxi3 = 0; _newaccion.acci_fechacreacion = DateTime.Now; _newaccion.acci_usuariocreacion = int.Parse(Session["usuCodigo"].ToString()); _newaccion.acci_terminalcreacion = Session["MachineName"].ToString(); } new CedenteDAO().FunInsertarAccionGestion(_newaccion); new FuncionesDAO().FunShowJSMessage("Gestión eliminado con éxito..!", this); _dts = new ConsultaDatosDAO().FunConsultaDatos(96, int.Parse(ViewState["codigoCLDE"].ToString()), 0, 0, "", "", "", Session["Conectar"].ToString()); GrdvGestiones.DataSource = _dts; GrdvGestiones.DataBind(); DdlMotivo3.SelectedValue = "0"; TxtObservacion3.Text = ""; } catch (Exception ex) { Lblerror.Text = ex.ToString(); } }
public void FunInsertarAccionGestion(SoftCob_ACCIONGESTION _accionges) { try { using (SoftCobEntities _db = new SoftCobEntities()) { _db.SoftCob_ACCIONGESTION.Add(_accionges); _db.SaveChanges(); } } catch (Exception ex) { throw ex; } }
protected void BtnCambiar_Click(object sender, EventArgs e) { try { if (ViewState["Operacion"] == null) { new FuncionesDAO().FunShowJSMessage("Seleccione Operación a Cambiar..!", this); return; } if (DdlAsignar.SelectedValue == "0") { new FuncionesDAO().FunShowJSMessage("Seleccione Gestor nuevo Asignado..!", this); return; } if (DdlMotivo1.SelectedValue == "0") { new FuncionesDAO().FunShowJSMessage("Seleccione Motivo..!", this); return; } if (string.IsNullOrEmpty(TxtObservacion1.Text.Trim())) { new FuncionesDAO().FunShowJSMessage("Ingrese Observación..!", this); return; } _dts = new ConsultaDatosDAO().FunConsultaDatos(97, int.Parse(ViewState["codigoCLDE"].ToString()), int.Parse(DdlAsignar.SelectedValue), 0, "", ViewState["Operacion"].ToString(), "", Session["Conectar"].ToString()); SoftCob_ACCIONGESTION _newaccion = new SoftCob_ACCIONGESTION(); { _newaccion.acci_tipoaccion = "CAMBIAR OPERACION"; _newaccion.acci_idmotivo = int.Parse(DdlMotivo1.SelectedValue); _newaccion.acci_observacion = TxtObservacion1.Text.Trim().ToUpper(); _newaccion.acci_codigocpce = int.Parse(ViewState["codigoCPCE"].ToString()); _newaccion.acci_identificacion = ViewState["Identificacion"].ToString(); _newaccion.acci_operacion = ViewState["Operacion"].ToString(); _newaccion.acci_gestoranterior = int.Parse(ViewState["GestorAsignado"].ToString()); _newaccion.acci_gestoractual = int.Parse(DdlAsignar.SelectedValue); _newaccion.acci_datoanterior = ""; _newaccion.acci_auxv1 = ""; _newaccion.acci_auxv2 = ""; _newaccion.acci_auxv3 = ""; _newaccion.acci_auxi1 = int.Parse(ViewState["codigoPERS"].ToString()); _newaccion.acci_auxi2 = 0; _newaccion.acci_auxi3 = 0; _newaccion.acci_fechacreacion = DateTime.Now; _newaccion.acci_usuariocreacion = int.Parse(Session["usuCodigo"].ToString()); _newaccion.acci_terminalcreacion = Session["MachineName"].ToString(); } new CedenteDAO().FunInsertarAccionGestion(_newaccion); new FuncionesDAO().FunShowJSMessage("Operacion Cambiada con éxito..!", this); _dts = new ConsultaDatosDAO().FunConsultaDatos(33, 0, int.Parse(ViewState["codigoCPCE"].ToString()), int.Parse(ViewState["codigoCLDE"].ToString()), ViewState["Catalogo"].ToString(), "", "", Session["Conectar"].ToString().ToString()); GrdvDatosObligacion.DataSource = _dts; GrdvDatosObligacion.DataBind(); DdlAsignar.SelectedValue = "0"; DdlMotivo1.SelectedValue = "0"; TxtObservacion1.Text = ""; ViewState["Operacion"] = null; } catch (Exception ex) { Lblerror.Text = ex.ToString(); } }