protected void btn_asignar_ServerClick(object sender, EventArgs e) { if ((codigo_seleccionado_centro != 0) && (codigo_seleccionado_medico !=0)) { try { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Centro_Medico_Veterinario obj = new WSGestion.MOD_Centro_Medico_Veterinario(); obj.CME_id_centro_atencion = codigo_seleccionado_centro; obj.CME_id_medico_veterinario = codigo_seleccionado_medico; obj.CME_activo = ""; wsgest.CRE_Centro_Medico_Veterinario(obj); Carga_Grid_Asignado(); } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } } else { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = "Debe de seleccionar un Centro de Atención y Médico Veterinario"; titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void lbkUsuarios_Click(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); Response.Redirect("frm_Home.aspx"); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Viene"] = null; }
protected void Page_Load(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString()) + "Codigo"] == null) { Response.Redirect("frm_Index.aspx"); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"] != null) { FormAccion = Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"].ToString(); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro"] != null) { centro = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"] != null) { codigo_seleccionado = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select_Dueno"] != null) { codigo_seleccionado_dueno = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select_Dueno"]); } if (!IsPostBack) { Cargar(); Carga_Detallle(); } }
protected void btn_agregar_Click(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); if ((txt_articulo.Value != "") && (txt_articulo.Value != "NONE")&&(txt_cantidad.Value != "0") && (txt_cantidad.Value != "")) { buscar = txt_articulo.Value; Carga_Lineas(); if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Error"] != null) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Error"].ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Error"] = null; } txt_cantidad.Value = "1"; txt_articulo.Value = ""; } else { Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "No se ha digitado ningún código de artículo o cantidad inválida"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; } }
protected void btn_certificado_ServerClick(object sender, EventArgs e) { try { if (codigo_seleccionado == 0) { Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "No se ha seleccionado ningún registro"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; } else { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select_Dueno"] = wsgest.SEL_Mascota_Dueno(codigo_seleccionado); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select_Mascota"] = codigo_seleccionado.ToString(); codigo_seleccionado = 0; Response.Redirect("frm_Grid_Certificado_Vacuna.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Centro_Seleccionado"] != null) { centro_seleccionado = Convert.ToInt32(Session["Centro_Seleccionado"]); } if (Session["Codigo_Select"] != null) { codigo_seleccionado = Convert.ToInt32(Session["Codigo_Select"]); } WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); if (!IsPostBack) { DataTable dt = wsgest.REP_Detalle_Entrada_Inventario(centro_seleccionado, centro_seleccionado); ReportViewer1.ProcessingMode = ProcessingMode.Local; LocalReport localReport = ReportViewer1.LocalReport; localReport.ReportPath = "ReportesWebs/RPT_Entrada_Inventario.rdlc"; ReportDataSource ds = new ReportDataSource(); ds.Name = "DS_Reporte_Entrada_Inventario"; // nombre del asistente para informes ds.Value = dt; ReportViewer1.LocalReport.DataSources.Clear(); localReport.DataSources.Add(ds); } }
protected void btn_detalle_ServerClick(object sender, EventArgs e) { try { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); if (codigo_seleccionado == 0) { Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "No se ha seleccionado ningún registro"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; } else { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Expediente"] = codigo_seleccionado.ToString(); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro_Expediente"] = centro_seleccionado.ToString(); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro"] = centro; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Perfil"] = perfil; codigo_seleccionado = 0; Response.Redirect("frm_Grid_Detalle_Expediente.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_editar_ServerClick(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); try { if (codigo_seleccionado == 0) { Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "No se ha seleccionado ningún registro"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; } else { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"] = codigo_seleccionado.ToString(); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro_Seleccionado"] = centro_seleccionado.ToString(); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Sucursal_Seleccionado"] = sucursal_seleccionado.ToString(); codigo_seleccionado = 0; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"] = "Editar"; Response.Redirect("frm_Bodega.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_eliminar_ServerClick(object sender, EventArgs e) { try { if ((codigo_seleccionado_asignado_centro == 0) && (codigo_seleccionado_asignado_medico == 0)) { Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "No se ha seleccionado ningún registro"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; } else { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); wsgest.DEL_Centro_Medico_Veterinario(codigo_seleccionado_asignado_medico,codigo_seleccionado_asignado_centro); Carga_Grid_Asignado(); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_regresar_ServerClick(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); Response.Redirect(Accion_Viene); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Viene"] = null; }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Articulo obj = new WSGestion.MOD_Articulo(); obj.ART_descripcion = txt_descripcion.Value; obj.ART_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); obj.ART_id_articulo = Convert.ToInt32(txt_codigo.Value); obj.ART_codigo_barras = txt_codigo_barras.Value; obj.ART_id_categoria_articulo = Convert.ToInt32(dl_categoria_articulo.SelectedValue); obj.ART_id_unidad_medida = Convert.ToInt32(dl_unidad_medida.SelectedValue); obj.ART_tipo = dl_tipo_articulo.SelectedValue; obj.PRE_art_precio = Convert.ToDecimal(txt_precio.Value, CultureInfo.CreateSpecificCulture("en-US")); obj.PRE_art_fecha = txt_fecha.Text; if (wsgest.CRE_Articulo(obj)) Response.Redirect("frm_Grid_Articulo.aspx"); else { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = "En la creación del artículo a nivel de la base de datos "; titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Articulo obj = new WSGestion.MOD_Articulo(); obj.ART_descripcion = txt_descripcion.Value; obj.ART_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); obj.ART_id_articulo = Convert.ToInt32(txt_codigo.Value); obj.ART_codigo_barras = txt_codigo_barras.Value; obj.ART_id_categoria_articulo = Convert.ToInt32(dl_categoria_articulo.SelectedValue); obj.ART_id_unidad_medida = Convert.ToInt32(dl_unidad_medida.SelectedValue); obj.ART_tipo = dl_tipo_articulo.SelectedValue; obj.PRE_art_precio = Convert.ToDecimal(txt_precio.Value, CultureInfo.CreateSpecificCulture("en-US")); obj.PRE_art_fecha = txt_fecha.Text; wsgest.UPD_Articulo(obj); Response.Redirect("frm_Grid_Articulo.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_aplicar_ServerClick(object sender, EventArgs e) { try { if (codigo_seleccionado == 0) { Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "No se ha seleccionado ningún registro"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; } else { int valor; WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); valor = wsgest.APL_Entrada_inventario(codigo_seleccionado, centro_seleccionado, bodega_seleccionado, sucursal_seleccionado); switch (valor) { case 0: Carga_Grid(); break; case 1: Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "El documento no contiene líneas para ser procesadas"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; break; case 2: Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "La entrada seleccionada ya se encuentra aplicada"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; break; case 3: Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "La entrada seleccionada ya se encuentra anulada"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; break; default: Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "Error en la ejecución del proceso en la base de datos"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; break; } } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_Salir_Click(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString()) + "usu_id_usuario"] = null; wsgest.UPD_Usuario_Session(codigo_usuario, "N", Session.SessionID.ToString()); Response.Redirect("frm_Index.aspx"); }
protected void btn_agregar_ServerClick(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"] = "Agregar"; codigo_seleccionado = 0; Response.Redirect("frm_Bodega.aspx"); }
protected void btn_agregar_ServerClick(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"] = "Agregar"; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Expediente"] = codigo_expediente; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro_Expediente"] = centro_expediente; Response.Redirect("frm_Detalle_Expediente.aspx"); }
protected void btn_agregar_ServerClick(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"] = "Agregar"; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select_Mascota"] = Codigo_Mascota.ToString(); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"] = 0; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro"] = centro; Response.Redirect("frm_Certificado_Vacunacion.aspx"); }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { if (this.Page.IsValid) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Mascota obj = new WSGestion.MOD_Mascota(); txt_codigo.Value = "0"; obj.MAS_id_mascota = Convert.ToInt32(txt_codigo.Value); obj.MAS_id_raza = Convert.ToInt32(dlRaza.SelectedValue); obj.MAS_nombre = txt_nombre.Value; obj.MAS_fecha_nacimiento = txt_fecha_nacimiento.Text; obj.MAS_sexo = dl_sexo.SelectedValue; obj.MAS_color = txt_color.Value; obj.MAS_observaciones = txt_observaciones.Value; obj.DXM_id_dueno = Convert.ToInt32( txt_codigo_dueno.Value); wsgest.CRE_Mascota(obj); Response.Redirect("frm_Grid_Mascota.aspx"); } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Mascota obj = new WSGestion.MOD_Mascota(); obj.MAS_id_mascota = Convert.ToInt32(txt_codigo.Value); obj.MAS_id_raza = Convert.ToInt32(dlRaza.SelectedValue); obj.MAS_nombre = txt_nombre.Value; obj.MAS_fecha_nacimiento = txt_fecha_nacimiento.Text; obj.MAS_sexo = dl_sexo.SelectedValue; obj.MAS_color = txt_color.Value; obj.MAS_observaciones = txt_observaciones.Value; obj.DXM_id_dueno = Convert.ToInt32(txt_codigo_dueno.Value); wsgest.UPD_Mascota(obj); Response.Redirect("frm_Grid_Mascota.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } } }
public void SetSubDataSource(object sender, SubreportProcessingEventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); DataTable dt = wsgest.REP_Detalle_Salida_Inventario(codigo_seleccionado, centro_seleccionado); ReportDataSource ds = new ReportDataSource(); ds.Name = "DS_RPT_DETALLE_SALIDA_INVENTARIO"; ds.Value = dt; e.DataSources.Add(ds); }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Dueno obj = new WSGestion.MOD_Dueno(); obj.DUE_nombre = txt_nombre.Value; obj.DUE_telefono = txt_telefono.Value; obj.DUE_pais = txt_pais.Value; obj.DUE_celular = txt_celular.Value; obj.DUE_apellido1 = txt_apellido1.Value; obj.DUE_apellido2 = txt_apellido2.Value; obj.DUE_codigo_postal = txt_codigo_postal.Value; obj.DUE_email = txt_email.Value; obj.DUE_cuidad = txt_cuidad.Value; wsgest.CRE_Dueno(obj); Response.Redirect("frm_Grid_Dueno.aspx"); } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Dueno obj = new WSGestion.MOD_Dueno(); obj.DUE_nombre = txt_nombre.Value; obj.DUE_telefono = txt_telefono.Value; obj.DUE_pais = txt_pais.Value; obj.DUE_celular = txt_celular.Value; obj.DUE_apellido1 = txt_apellido1.Value; obj.DUE_apellido2 = txt_apellido2.Value; obj.DUE_codigo_postal = txt_codigo_postal.Value; obj.DUE_cuidad = txt_cuidad.Value; obj.DUE_email = txt_email.Value; obj.DUE_id_dueno = Convert.ToInt32(txt_codigo.Value); wsgest.UPD_Dueno(obj); Response.Redirect("frm_Grid_Dueno.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); try { if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString()) + "Codigo"] == null) { Response.Redirect("frm_Index.aspx"); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"] != null) { FormAccion = Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"].ToString(); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro"] != null) { centro = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"] != null) { codigo_seleccionado = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro_Seleccionado"] != null) { centro_seleccionado = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro_Seleccionado"]); } if (!IsPostBack) { txt_cea_codigo.Value = centro.ToString(); Carga_Centro_Nombre(centro); if (centro != 1) { txt_cea_codigo.Disabled = true; txt_cea_nombre.Disabled = true; } if (FormAccion == "Editar") { if (codigo_seleccionado != 0) { Carga_Editar(); } } } } catch (Exception exc) { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"] = "0"; Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Detalle_Expediente obj = new WSGestion.MOD_Detalle_Expediente(); obj.DEX_id_expediente = Convert.ToInt32(txt_codigo_expediente.Value); obj.DEX_id_centro_atencion = Convert.ToInt32(txt_centro.Value); obj.DEX_fecha = Convert.ToDateTime(txt_fecha.Text).ToString("dd/MM/yyyy hh:mm:ss"); obj.DEX_peso = Convert.ToDecimal(txt_peso.Value); obj.DEX_longitud = Convert.ToDecimal(txt_logitud.Value); obj.DEX_id_articulo = Convert.ToInt32(txt_articulo.Value); obj.DEX_cantidad = Convert.ToDecimal(txt_cantidad.Value); wsgest.CRE_Detalle_Expediente(obj); Response.Redirect("frm_Grid_Detalle_Expediente.aspx"); } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Detalle_Expediente obj = new WSGestion.MOD_Detalle_Expediente(); obj.DEX_id_linea = Convert.ToInt32(txt_codigo.Value); obj.DEX_id_expediente = Convert.ToInt32(txt_codigo_expediente.Value); obj.DEX_id_centro_atencion = Convert.ToInt32(txt_centro.Value); obj.DEX_fecha = Convert.ToDateTime(txt_fecha.Text).ToString("dd/MM/yyyy hh:mm:ss"); obj.DEX_peso = Convert.ToDecimal(txt_peso.Value); obj.DEX_longitud = Convert.ToDecimal(txt_logitud.Value); obj.DEX_id_articulo = Convert.ToInt32(txt_articulo.Value); obj.DEX_cantidad = Convert.ToDecimal(txt_cantidad.Value); wsgest.UPD_Detalle_Expediente(obj); Response.Redirect("frm_Grid_Detalle_Expediente.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_buscar_articulo_Click(object sender, EventArgs e) { if (txt_articulo.Value != "") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Articulo obj = new WSGestion.MOD_Articulo(); obj = wsgest.SEL_GRID_BY_ID_Articulo(Convert.ToInt32(txt_articulo.Value), centro_seleccionado); if ( (obj.ART_id_articulo != 0) && (obj.ART_tipo == "T")) { Alert_Mensaje.Visible = false; txt_descripcion.Value = obj.ART_descripcion; } else { txt_descripcion.Value = null; txt_articulo.Value = null; txt_articulo.Attributes.Add("onfocus", "this.select();"); txt_articulo.Focus(); Alert_Mensaje.Attributes["class"] = "alert alert-danger"; if (obj.ART_tipo == "S") { mensaje_alerta = "El artículo digitado es de tipo servicio y este no puede ser agregado a una bodega"; } else { mensaje_alerta = "El artículo digitado no se encuentra en la base de datos"; } titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } } else { txt_descripcion.Value = null; txt_articulo.Value = null; txt_articulo.Attributes.Add("onfocus", "this.select();"); txt_articulo.Focus(); Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "Debe de digitar un dato en el campo artículo"; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; } }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Certificado_Vacunacion obj = new WSGestion.MOD_Certificado_Vacunacion(); obj.DET_cer_vac_id_certificado_vacunacion = Convert.ToInt32(txt_codigo.Value); obj.DET_cer_vac_id_mascota = Convert.ToInt32(Codigo_Mascota); obj.DET_cer_vac_fecha = Convert.ToDateTime(txt_fecha.Text).ToString("dd/MM/yyyy hh:mm:ss"); obj.DET_cer_vac_descripcion = txt_descripcion.Value; obj.DET_cer_vac_lote = txt_lote.Value; obj.DET_cer_vac_id_medico_veterinario = Convert.ToInt32(txt_cod_medico.Value); wsgest.CRE_Certificado_Vacunacion(obj); Response.Redirect("frm_Grid_Certificado_Vacuna.aspx"); } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Certificado_Vacunacion obj = new WSGestion.MOD_Certificado_Vacunacion(); obj.DET_cer_vac_id_certificado_vacunacion = Convert.ToInt32(txt_codigo.Value); obj.DET_cer_vac_linea = Convert.ToInt32(codigo_linea); obj.DET_cer_vac_fecha = Convert.ToDateTime(txt_fecha.Text).ToString("dd/MM/yyyy hh:mm:ss"); obj.DET_cer_vac_descripcion = txt_descripcion.Value; obj.DET_cer_vac_lote = txt_lote.Value; obj.DET_cer_vac_id_medico_veterinario = Convert.ToInt32(txt_cod_medico.Value); wsgest.UPD_Certificado_Vacunacion(obj); Response.Redirect("frm_Grid_Certificado_Vacuna.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Entrada_Inventario obj = new WSGestion.MOD_Entrada_Inventario(); obj.ENT_inv_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); obj.ENT_inv_id_bodega = Convert.ToInt32(dl_id_bodega.SelectedValue); obj.ENT_inv_id_sucursal = Convert.ToInt32(dl_id_sucursal.SelectedValue); obj.ENT_inv_fecha = Convert.ToDateTime(txt_fecha.Text).ToString("dd/MM/yyyy hh:mm:ss"); obj.ENT_inv_aplicada = "N"; obj.ENT_inv_origen = "INVENTARIO"; wsgest.CRE_Entrada_Inventario(obj); Response.Redirect("frm_Grid_Entrada_Inventario.aspx"); } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Entrada_Inventario obj = new WSGestion.MOD_Entrada_Inventario(); obj.ENT_inv_id_entrada_inventario = Convert.ToInt32(txt_codigo.Value); obj.ENT_inv_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); obj.ENT_inv_id_bodega = Convert.ToInt32(dl_id_bodega.SelectedValue); obj.ENT_inv_id_sucursal = Convert.ToInt32(dl_id_sucursal.SelectedValue); obj.ENT_inv_fecha = Convert.ToDateTime(txt_fecha.Text).ToString("dd/MM/yyyy hh:mm:ss"); obj.ENT_inv_aplicada = dl_estado.SelectedValue; wsgest.UPD_Entrada_Inventario(obj); Response.Redirect("frm_Grid_Entrada_Inventario.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
private void Cargar() { try { DateTime oDate; WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Mascota obj = new WSGestion.MOD_Mascota(); obj = wsgest.SEL_GRID_BY_ID_Mascota(codigo_seleccionado); lbl_id_mascota.Text = obj.MAS_id_mascota.ToString(); lbl_raza.Text = obj.RAZ_descripcion; lbl_nombre_mascota.Text = obj.MAS_nombre; oDate = DateTime.Parse(obj.MAS_fecha_nacimiento); lbl_fecha_nacimiento.Text = oDate.ToShortDateString(); lbl_color.Text = obj.MAS_color; lbl_observaciones.Text = obj.MAS_observaciones; if (obj.MAS_sexo == "M") { lbl_sexo.Text = "Macho"; } else { lbl_sexo.Text = "Hembra"; } WSGestion.MOD_Dueno obj2 = new WSGestion.MOD_Dueno(); obj2 = wsgest.SEL_GRID_BY_ID_Dueno(codigo_seleccionado_dueno); lbl_nombre_dueno.Text = obj2.DUE_nombre + " " + obj2.DUE_apellido1 + " " + obj2.DUE_apellido2; lbl_id_dueno.Text = obj2.DUE_id_dueno.ToString(); lbl_telefono.Text = obj2.DUE_telefono; lbl_celular.Text = obj2.DUE_celular; WSGestion.MOD_Expediente obj3 = new WSGestion.MOD_Expediente(); obj3 = wsgest.SEL_GRID_Expediente_BY_ID_Mascota(codigo_seleccionado,centro); lbl_numero_expediente.Text = obj3.EXP_id_expediente.ToString(); codigo_expediente_seleccionado = obj3.EXP_id_expediente; oDate = DateTime.Parse(obj3.EXP_fecha_creacion); lbl_fecha_generacion.Text = oDate.ToShortDateString(); } catch (Exception) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"] = "0"; } }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { //aqui se debe de guardar tanto la visita , el detalle en el expediente y generar la factura try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Visita obj = new WSGestion.MOD_Visita(); //obj.vc= Convert.ToInt32(txt_cea_codigo.Value); //obj.CIT_id_mascota = codigo_mascota; //obj.CIT_fecha = Convert.ToDateTime(txt_fecha.Text).ToString("MM/dd/yyyy hh:mm:ss"); //obj.CIT_estado = dl_estado.SelectedValue; //wsgest.CRE_Visita(obj); //Response.Redirect("frm_Grid_Cita.aspx"); } //if (FormAccion == "Editar") //{ // WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); // wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); // WSGestion.MOD_Visita obj = new WSGestion.MOD_Visita(); // obj.CIT_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); // obj.CIT_id_mascota = codigo_mascota; // obj.CIT_fecha = Convert.ToDateTime(txt_fecha.Text).ToString("MM/dd/yyyy hh:mm:ss"); // obj.CIT_estado = dl_estado.SelectedValue; // obj.CIT_id_Visita = Convert.ToInt32(txt_codigo.Value); // wsgest.UPD_Visita(obj); // Response.Redirect("frm_Grid_Visita.aspx"); //} } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Sucursal obj = new WSGestion.MOD_Sucursal(); obj.SUC_nombre = txt_nombre.Value; obj.SUC_telefono = txt_telefono.Value; obj.SUC_direccion = txt_direccion.Value; obj.SUC_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); obj.SUC_id_sucursal = Convert.ToInt32(txt_codigo.Value); wsgest.CRE_Sucursal(obj); Response.Redirect("frm_Grid_Sucursal.aspx"); } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Sucursal obj = new WSGestion.MOD_Sucursal(); obj.SUC_nombre = txt_nombre.Value; obj.SUC_telefono = txt_telefono.Value; obj.SUC_direccion = txt_direccion.Value; obj.SUC_id_centro_atencion = Convert.ToInt32(txt_cea_codigo.Value); obj.SUC_id_sucursal = Convert.ToInt32(txt_codigo.Value); wsgest.UPD_Sucursal(obj); Response.Redirect("frm_Grid_Sucursal.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_guardar_ServerClick(object sender, EventArgs e) { try { if (FormAccion == "Agregar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Medico_Veterinario obj = new WSGestion.MOD_Medico_Veterinario(); obj.MVE_nombre = txt_nombre.Value; obj.MVE_apellido1 = txt_apellido1.Value; obj.MVE_apellido2 = txt_apellido2.Value; obj.MVE_cod_medico_veterinario = Convert.ToInt32( txt_codigo.Value); obj.MVE_id_medico_veterinario = Convert.ToInt32(txt_codigo.Value); obj.MVE_id_estado_medico_veterinario = Convert.ToInt32(dlEstado.SelectedValue); wsgest.CRE_Medico_Veterinario(obj); Response.Redirect("frm_Grid_Medico_Veterinario.aspx"); } if (FormAccion == "Editar") { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Medico_Veterinario obj = new WSGestion.MOD_Medico_Veterinario(); obj.MVE_nombre = txt_nombre.Value; obj.MVE_apellido1 = txt_apellido1.Value; obj.MVE_apellido2 = txt_apellido2.Value; obj.MVE_cod_medico_veterinario = Convert.ToInt32(txt_codigo.Value); obj.MVE_id_medico_veterinario = Convert.ToInt32(txt_codigo.Value); obj.MVE_id_estado_medico_veterinario = Convert.ToInt32(dlEstado.SelectedValue); wsgest.UPD_Medico_Veterinario(obj); Response.Redirect("frm_Grid_Medico_Veterinario.aspx"); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void btn_asignar_ServerClick(object sender, EventArgs e) { try { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); codigoModulo = Convert.ToInt32(dlModulos.SelectedValue); codigoPerfil = Convert.ToInt32(dlPerfil.SelectedValue); codigoPermiso = Convert.ToInt32(dlPermisos.SelectedValue); int cant_perm = wsgest.SEL_Perfil_Permiso_ModuloByIDs(codigoPerfil, codigoPermiso, codigoModulo); if (cant_perm == 0) { if (wsgest.CRE_Perfil_Permiso_Modulo(codigoPerfil,codigoPermiso,codigoModulo)) { Modulo = dlModulos.SelectedItem.ToString(); Perfil = dlPerfil.SelectedItem.ToString(); CargaGrid(); } else { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = "En el procedimiento almacenado"; titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } } else { Alert_Mensaje.Attributes["class"] = "alert alert-warning"; mensaje_alerta = "No es válido introducir el mismo permiso para este modulo y perfil."; titulo_mensaje_alerta = "Advertencia: "; Alert_Mensaje.Visible = true; } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString()) + "Codigo"] == null) { Response.Redirect("frm_Index.aspx"); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro_Seleccionado"] != null) { centro_seleccionado = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Centro_Seleccionado"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"] != null) { codigo_seleccionado = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Viene"] != null) { Accion_Viene = Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Viene"].ToString(); } if (!IsPostBack) { DataTable dt = wsgest.REP_Salida_Inventario(codigo_seleccionado, centro_seleccionado); ReportViewer1.ProcessingMode = ProcessingMode.Local; LocalReport localReport = ReportViewer1.LocalReport; localReport.ReportPath = "ReportesWebs/rpt_Salida_Inventario.rdlc"; ReportDataSource ds = new ReportDataSource(); ds.Name = "DS_RPT_SALIDA_INVENTARIO";// nombre del asistente para informes ds.Value = dt; ReportViewer1.LocalReport.DataSources.Clear(); localReport.DataSources.Add(ds); ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource); } }