Пример #1
0
        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;
            }
        }
        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";
            }
        }
Пример #3
0
 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;
     }
 }
Пример #4
0
        private void Carga_Editar()
        {
            try
            {
                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);
                txt_codigo.Value = obj.MAS_id_mascota.ToString();
                dlRaza.SelectedIndex = obj.MAS_id_raza;
                txt_nombre.Value = obj.MAS_nombre;
                DateTime Fecha = Convert.ToDateTime(obj.MAS_fecha_nacimiento);
                Fecha_Formato = Fecha.ToString("MM/dd/yyyy");
                txt_color.Value = obj.MAS_color;
                txt_observaciones.Value = obj.MAS_observaciones;
                dl_sexo.SelectedValue = obj.MAS_sexo;

                WSGestion.MOD_Dueno obj2 = new WSGestion.MOD_Dueno();
                obj2 = wsgest.SEL_GRID_BY_ID_Dueno(Convert.ToInt32(wsgest.SEL_Mascota_Dueno(codigo_seleccionado)));
                txt_nombre_dueno.Value = obj2.DUE_nombre + " " + obj2.DUE_apellido1 + " " + obj2.DUE_apellido2;
                txt_codigo_dueno.Value = obj2.DUE_id_dueno.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;
            }
        }
        private void Cargar()
        {
            try
            {
                DateTime oDate;

                WSGestion.WSGestion wsgest = new WSGestion.WSGestion();
                wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs");

                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();

                if (obj3.EXP_id_expediente != 0)
                {
                    codigo_expediente_seleccionado = obj3.EXP_id_expediente;
                    oDate = DateTime.Parse(obj3.EXP_fecha_creacion);
                    lbl_fecha_generacion.Text = oDate.ToShortDateString();

                    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;
                }
                else
                {
                    Session[wsgest.Get_usu_id_session(Session.SessionID.ToString())+"Codigo_Select"] = "0";
                    Alert_Mensaje.Attributes["class"] = "alert alert-warning";
                    mensaje_alerta = "No se tiene un expediente para la mascota";
                    titulo_mensaje_alerta = "Advertencia: ";
                    Alert_Mensaje.Visible = 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;
            }
        }
Пример #6
0
        private void Cargar_Datos_Cita()
        {
            try
            {
                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_mascota);
                lbl_id_mascota.Text = obj.MAS_id_mascota.ToString();
                lbl_nombre_mascota.Text = obj.MAS_nombre;

                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;

            }
            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;
            }
        }