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