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_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) { 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"] = codigo_seleccionado.ToString(); codigo_seleccionado = 0; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"FormAccion"] = "Editar"; Response.Redirect("frm_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_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 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_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 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 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_articulos_ServerClick(object sender, EventArgs e) { 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_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(); Response.Redirect("frm_Bodega_Articulo.aspx"); } }
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 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())+"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())+"Nombre_Articulo"] != null) { nombre_articulo_seleccionado = Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Nombre_Articulo"].ToString(); } 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_codigo.Value = codigo_seleccionado.ToString(); txt_descripcion.Value = nombre_articulo_seleccionado; Carga_Grid(); } } 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) { codigo = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo"]); puesto = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString()) + "Perfil"]); actualizacion_datos(); } else { Response.Redirect("frm_Index.aspx"); } } catch (Exception exc) { throw exc; } }
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); } }
protected void btn_regresar_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())+"ULT_Linea"] = null; Response.Redirect("frm_Grid_Entrada_Inventario.aspx"); }
protected void btn_imprimir_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())+"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())+"Viene"] = "frm_Grid_Detalle_Entrada_Inventario.aspx"; codigo_seleccionado = 0; Response.Redirect("rpt_Entrada_Inventario.aspx"); }
protected void btn_eliminar_hide_Click(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"); if (wsgest.DEL_Detalle_Entrada_Inventario(Convert.ToInt32(txt_linea.Value),codigo_seleccionado,centro_seleccionado)) { DataTable dt = new DataTable(); dt = (DataTable)Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Lineas"]; dt.Rows[Convert.ToInt32(txt_linea.Value) - 1].Delete(); int i = 0; while (i < dt.Rows.Count) { dt.Rows[i]["Línea"] = ++i; } Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"ULT_Linea"] = dt.Rows.Count.ToString(); gridview_lineas.DataSource = dt; gridview_lineas.DataBind(); } txt_articulo.Value = ""; txt_linea.Value = ""; txt_descripcion.Value = ""; txt_cantidad.Value = "1"; } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
private void Carga_Editar() { try { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Dueno obj = new WSGestion.MOD_Dueno(); obj = wsgest.SEL_GRID_BY_ID_Dueno(codigo_seleccionado); txt_nombre.Value = obj.DUE_nombre; txt_telefono.Value = obj.DUE_telefono; txt_celular.Value = obj.DUE_celular; txt_codigo.Value = obj.DUE_id_dueno.ToString(); txt_pais.Value = obj.DUE_pais; txt_apellido1.Value = obj.DUE_apellido1; txt_apellido2.Value = obj.DUE_apellido2; txt_codigo_postal.Value = obj.DUE_codigo_postal; txt_email.Value = obj.DUE_email; txt_cuidad.Value = obj.DUE_cuidad; } catch (Exception exc) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); 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; } }
private void Editar_Lineas() { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); DataTable dt = new DataTable(); dt = (DataTable)Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Lineas"]; try { WSGestion.MOD_Articulo obj = new WSGestion.MOD_Articulo(); obj = wsgest.SEL_GRID_BY_ID_Articulo_For_Inventario(buscar, centro_seleccionado, sucursal_seleccionado, bodega_seleccionado); if (obj.CEA_nombre != null) { WSGestion.MOD_Detalle_Entrada_Inventario obj2 = new WSGestion.MOD_Detalle_Entrada_Inventario(); obj2.DET_ent_inv_id_linea = Convert.ToInt32 (txt_linea.Value); obj2.DET_ent_inv_id_entrada_inventario = codigo_seleccionado; obj2.DET_ent_inv_id_centro_atencion = centro_seleccionado; obj2.DET_ent_inv_id_articulo = obj.ART_id_articulo; obj2.DET_ent_inv_cantidad = Convert.ToDouble(txt_cantidad.Value, CultureInfo.CreateSpecificCulture("en-US")); wsgest.UPD_Detalle_Entrada_Inventario(obj2); dt.Rows[Convert.ToInt32(txt_linea.Value) - 1]["Artículo"] = obj.ART_id_articulo.ToString(); dt.Rows[Convert.ToInt32(txt_linea.Value) - 1]["Descripción"] = obj.ART_descripcion.ToString(); dt.Rows[Convert.ToInt32(txt_linea.Value) - 1]["Cantidad"] = txt_cantidad.Value.ToString(CultureInfo.CreateSpecificCulture("en-US")); } else { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Error"] = "Artículo digitado no se encuentra en la base de datos"; } gridview_lineas.DataSource = dt; gridview_lineas.DataBind(); } catch (Exception exc) { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Error"] = exc.ToString(); } }
private void Carga_Lineas() { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); DataTable dt = new DataTable(); dt = (DataTable)Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Lineas"]; try { WSGestion.MOD_Articulo obj = new WSGestion.MOD_Articulo(); obj = wsgest.SEL_GRID_BY_ID_Articulo_For_Inventario(buscar, centro_seleccionado, sucursal_seleccionado,bodega_seleccionado); if (obj.CEA_nombre != null) { WSGestion.MOD_Detalle_Entrada_Inventario obj2 = new WSGestion.MOD_Detalle_Entrada_Inventario(); obj2.DET_ent_inv_id_linea = ult_linea; obj2.DET_ent_inv_id_entrada_inventario = codigo_seleccionado; obj2.DET_ent_inv_id_centro_atencion = centro_seleccionado; obj2.DET_ent_inv_id_articulo = obj.ART_id_articulo; obj2.DET_ent_inv_cantidad = Convert.ToDouble(txt_cantidad.Value, CultureInfo.CreateSpecificCulture("en-US")); int valor = wsgest.CRE_Detalle_Entrada_Inventario(obj2); if (valor==1) { dt.Rows.Add(ult_linea, obj.ART_id_articulo, obj.ART_descripcion, Convert.ToDecimal(txt_cantidad.Value)); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"ULT_Linea"] = dt.Rows.Count.ToString(); } else { if (valor==2) { foreach (DataRow row in dt.Rows) { if (row["Artículo"].ToString() == obj.ART_id_articulo.ToString()) { row["Cantidad"] = (Convert.ToDecimal(row["Cantidad"].ToString()) + Convert.ToDecimal(txt_cantidad.Value)).ToString(CultureInfo.CreateSpecificCulture("en-US")); } } } else { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Error"] = "Se produjo un error en la ejecución de la sentencia en la base de datos"; } } } else { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Error"] = "Artículo digitado no se encuentra en la base de datos o bien no pertenece a la bodega del documento"; } gridview_lineas.DataSource = dt; gridview_lineas.DataBind(); } catch (Exception exc) { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Error"] = "Error: " + exc.ToString(); } }
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 = 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_Mascota"] != null) { Codigo_Mascota = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select_Mascota"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Linea"] != null) { codigo_linea = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Linea"]); } if (!IsPostBack) { if (FormAccion == "Editar") { if (codigo != 0) { Carga_Editar(); } } else { DateTime Fecha = DateTime.Today; Fecha_Formato = Fecha.ToString("MM/dd/yyyy hh:mm:ss tt"); } WSGestion.MOD_Certificado_Vacunacion obj = new WSGestion.MOD_Certificado_Vacunacion(); obj = wsgest.SEL_CERTIFICADO_BY_ID_MASCOTA(Codigo_Mascota); txt_codigo.Value = obj.DET_cer_vac_id_certificado_vacunacion.ToString(); } } 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; } }
private void Carga_Editar() { try { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Certificado_Vacunacion obj = new WSGestion.MOD_Certificado_Vacunacion(); obj = wsgest.SEL_GRID_BY_ID_Certificado_Vacunacion(codigo,codigo_linea); txt_codigo.Value = obj.DET_cer_vac_id_certificado_vacunacion.ToString(); DateTime Fecha = Convert.ToDateTime(obj.DET_cer_vac_fecha); Fecha_Formato = Fecha.ToString("dd/MM/yyyy hh:mm:ss tt"); txt_fecha.Text = Fecha_Formato; txt_descripcion.Value = obj.DET_cer_vac_descripcion.ToString(); txt_lote.Value = obj.DET_cer_vac_lote.ToString(); txt_cod_medico.Value = obj.DET_cer_vac_id_medico_veterinario.ToString(); } catch (Exception exc) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); 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 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())+"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())+"Sucursal_Seleccionado"] != null) { sucursal_seleccionado = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Sucursal_Seleccionado"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Bodega_Seleccionado"] != null) { bodega_seleccionado = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Bodega_Seleccionado"]); } if (Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"ULT_Linea"] != null) { ult_linea = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"ULT_Linea"]) + 1; } else { ult_linea = 1; } if (!IsPostBack) { Carga_Lineas_Editar(); Cargar_Datos(); } } catch (Exception exc) { Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select_Cita"] = "0"; Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }
private void Cargar_Datos() { try { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Entrada_Inventario obj = new WSGestion.MOD_Entrada_Inventario(); obj = wsgest.SEL_GRID_BY_ID_Entrada_Inventario(codigo_seleccionado,centro_seleccionado); lbl_id_entradad.Text = obj.ENT_inv_id_entrada_inventario.ToString(); lbl_codigo_titulo.Text = lbl_id_entradad.Text; lbl_centro_atencion.Text = obj.ENT_inv_id_centro_atencion.ToString() + " " + obj.CEA_nombre; lbl_sucursal.Text = obj.ENT_inv_id_sucursal.ToString() + " " + obj.SUC_nombre; lbl_bodega.Text = obj.ENT_inv_id_bodega.ToString() + " " + obj.BOD_descripcion; lbl_fecha.Text = obj.ENT_inv_fecha.ToString(); if (obj.ENT_inv_aplicada == "S") { btn_agregar_linea.Enabled = false; btn_eliminar.Disabled = true; txt_articulo.Disabled = true; txt_cantidad.Disabled = true; btn_aplicar.Disabled = true; } } catch (Exception exc) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); 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; } }
private void Carga_Editar() { try { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Visita obj = new WSGestion.MOD_Visita(); obj = wsgest.SEL_GRID_BY_ID_Visita(codigo_seleccionado, centro); txt_codigo.Value = obj.VCE_id_visita_centro_visita.ToString(); DateTime Fecha = Convert.ToDateTime(obj.VCE_fecha); Fecha_Formato = Fecha.ToString("MM/dd/yyyy hh:mm:ss tt"); txt_cea_codigo.Value = obj.CEA_id_centro_atencion.ToString(); txt_cea_nombre.Value = obj.CEA_nombre; txt_nombre_mascota.Value = obj.MAS_nombre; } catch (Exception exc) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); 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; } }
private void Carga_Lineas_Editar() { DataTable dt = new DataTable(); dt.Columns.Add("Línea", Type.GetType("System.String")); dt.Columns.Add("Artículo", Type.GetType("System.String")); dt.Columns.Add("Descripción", Type.GetType("System.String")); dt.Columns.Add("Cantidad", Type.GetType("System.String")); WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); double valor = 0; List<WSGestion.MOD_Detalle_Entrada_Inventario> lista_editar = wsgest.SEL_GRID_Detalle_Entrada_Inventario(codigo_seleccionado, centro_seleccionado).ToList(); for (int i = 0; i < lista_editar.Count; i++) { dt.Rows.Add(); dt.Rows[dt.Rows.Count - 1]["Línea"] = lista_editar[i].DET_ent_inv_id_linea; dt.Rows[dt.Rows.Count - 1]["Artículo"] = lista_editar[i].DET_ent_inv_id_articulo; dt.Rows[dt.Rows.Count - 1]["Descripción"] = lista_editar[i].ART_descripcion; valor = Convert.ToDouble(lista_editar[i].DET_ent_inv_cantidad, CultureInfo.CreateSpecificCulture("en-US")); dt.Rows[dt.Rows.Count - 1]["Cantidad"] = valor.ToString(CultureInfo.CreateSpecificCulture("en-US")); } gridview_lineas.DataSource = dt; gridview_lineas.DataBind(); Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Lineas"] = dt; Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"ULT_Linea"] = dt.Rows.Count.ToString(); txt_cantidad.Value = "1"; }
private void Carga_Editar() { try { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); WSGestion.MOD_Estado_Usuario obj = new WSGestion.MOD_Estado_Usuario(); obj = wsgest.SEL_GRID_BY_ID_Estado_Usuario(codigo_seleccionado); txt_nombre.Value = obj.ESTUSU_nombre; txt_codigo.Value = obj.ESTUSU_id_estado_usuario.ToString(); } catch (Exception exc) { WSGestion.WSGestion wsgest = new WSGestion.WSGestion(); wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs"); 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_aplicar_ServerClick(object sender, EventArgs e) { try { 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: Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"ULT_Linea"] = null; Response.Redirect("frm_Grid_Entrada_Inventario.aspx"); 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 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())+"Perfil"] != null) { perfil = Convert.ToInt32(Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Perfil"]); } 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 (!IsPostBack) { btn_agregar.Visible = false; btn_editar.Visible = false; btn_eliminar.Visible = false; lectura_permisos(); } } catch (Exception exc) { Alert_Mensaje.Attributes["class"] = "alert alert-danger"; mensaje_alerta = exc.ToString(); titulo_mensaje_alerta = "Error: "; Alert_Mensaje.Visible = true; } }