From dc3af49e753efde7b2a92b7bca114a56b6e8ca22 Mon Sep 17 00:00:00 2001 From: AbrahamCastilloV Date: Tue, 23 Jan 2024 15:59:00 -0700 Subject: [PATCH 01/15] =?UTF-8?q?--Se=20implement=C3=B3=20la=20acci=C3=B3n?= =?UTF-8?q?=20de=20exportar=20a=20excel=20en=20contratos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Transportes/RepContratos.aspx | 135 +++++++++++++++---------------- Transportes/RepContratos.aspx.vb | 7 ++ 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/Transportes/RepContratos.aspx b/Transportes/RepContratos.aspx index a6e58d5a8..409f5b386 100644 --- a/Transportes/RepContratos.aspx +++ b/Transportes/RepContratos.aspx @@ -34,21 +34,12 @@ - - -
  • - Agregar Contrato -
  • - <%--
  • - Contratos -
  • -
  • - Viajes -
  • --%> -
    -
    +
  • + Agregar Contrato +
  • +
  • + Generar Excel +
  • @@ -61,70 +52,72 @@ + + + + - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + Fecha
    + Salida +
    + + + +
    - - - Fecha
    - Salida -
    - - - -
    + + + Fecha
    + Regreso +
    + + + +
    - - - Fecha
    - Regreso -
    - - - -
    - - - - - - - - -
    -
    + + + + + + +
    +
    +
    +
    diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 5d31eacd1..dbcbea3a7 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -5876,13 +5876,21 @@ Partial Class Ventas CveTipoVenta = If(DbRowVenta("CveTipoVenta").ToString.ToEntero > 0, DbRowVenta("CveTipoVenta").ToString.ToEntero, -1) + TrVentasMedicas3.Visible = True + If DbRowVenta("CveMedico").ToString.ToEntero > 0 AndAlso CveTipoVenta.Contiene(1, 2, 3, 5) Then TrVentasMedicas1.Visible = True + DdlMedico.SelectedValueExist(DbRowVenta("CveMedico").ToString) DdlProcedimiento.SelectedValueExist(DbRowVenta("CveProcedimiento").ToString) + TxtPaciente.Text = DbRowVenta("Paciente").ToString + TxtEpisodio.Text = DbRowVenta("Episodio").ToString DdlMedico.Enabled = False DdlProcedimiento.Enabled = False + TxtPaciente.Enabled = False + TxtEpisodio.Enabled = False + If DbRowVenta("FechaParaSurtir").ToString().ToDate() > DateTime.MinValue Then TrVentasMedicas2.Visible = True @@ -13335,7 +13343,8 @@ Partial Class Ventas Kilometraje:=TxtKilometraje.Text.ToDouble, EsAmortizacion:=EsNCAmortizacion, CveTipoRetencion:=factura.CveTipoRetencion, CorreoNotificacion:=TxtCorreoNotificaciones.Text, FormaPaqueteria:=RblPaqueteria.SelectedValue.ToEntero, FacturarSucursal:=factura.FacturarSucursal, VentaDesglosaIEPS:=factura.VentaDesglosaIEPS, RFCReceptor:=RFCReceptor, Adjunto:=Adjunto, DevolucionImportePagado:=factura.DevolucionImportePagado, EsGarantia:=factura.EsGarantia, ServicioDomicilio:=TrServicioDomicilio.Visible, CveLineaAdicional:=DdlLineaAdicional.SelectedValue.ToEntero(), DescripcionVenta:=DescripcionVenta, - CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir) Then + CveMedico:=CveMedico, CveProcedimiento:=CveProcedimiento, CveTipoVenta:=CveTipoVentaGuardar, RequiereOS:=ChkRequiereTecnico.Checked, FechaParaSurtir:=factura.FechaParaSurtir, + Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") Else If factura.TipoDocto.Contiene("Dev", "Egs") OrElse DtVentasNC IsNot Nothing OrElse CveEstatusRefacturacion > 0 OrElse CveAnticipoPadre > 0 Then @@ -17684,9 +17693,9 @@ Partial Class Ventas End If - If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then + If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Or UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then 'VALIDA EXISTENCIA - If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153, 140}) Then + If UsuarioActual.CveEmpresa.Contiene({72, 80, 119, 153, 140, 186}) Then If CveVenta <= 0 OrElse Me.EsCreaApartirDe Then If Existencia - TmpDT.SUM("Cantidad", $"CvePS = {CvePS} AND (EntregaDirecta IS NULL OR EntregaDirecta < 1)") < TxtCantidad.Text.ToDouble Then Alert("No cuenta con la cantidad suficiente en inventario. Cuenta con " + Existencia.FormatoNumero(2) + ".", TipoMensaje.MsgAdvertencia) @@ -21670,6 +21679,8 @@ Partial Class Ventas TrVentasMedicas1.Visible = True DdlMedico.Enabled = True DdlProcedimiento.Enabled = True + TxtPaciente.Enabled = True + TxtEpisodio.Enabled = True End If @@ -21844,7 +21855,8 @@ Partial Class Ventas PedidoContrato:=TxtPedidoContrato.Text, AtencionA:=TxtAtencionA.Text.Trim, CveMetodoPago33:=DdlMetodoPago33.SelectedValue.ToEntero(), CveFormaPago33:=DdlFormaPago33.SelectedValue.ToEntero(), TipoDocto:=DdlTipoComprobante.SelectedValue, CveCliente:=CveCliente, CveClienteSucursal:=CveClienteSucursal, OrdenCompra:=TxtOrdenCompra.Text, RetIVA:=TxtRetIVA.Text.ToDecimal, RetISR:=TxtRetISR.Text.ToDecimal, Kilometraje:=TxtKilometraje.Text.ToDecimal, CveUsoCFDi:=DdlUsoCFDI.SelectedValue.ToEntero(), - CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir) Then + CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), ServicioDomicilio:=TrServicioDomicilio.Visible, CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, + FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, Episodio:=TxtEpisodio.Text) Then OcurrioError = True End If @@ -33679,6 +33691,8 @@ Partial Class Ventas TrVentasMedicas1.Visible = True DdlMedico.Enabled = True DdlProcedimiento.Enabled = True + TxtPaciente.Enabled = True + TxtEpisodio.Enabled = True End If If UsuarioActual.TienePermisoProceso(289) Then @@ -33735,7 +33749,8 @@ Partial Class Ventas If Not ObjVentas.UpdateObservacionesVenta(Me.CveVenta, UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(), TxtObsFact.Text, RblPaqueteria.SelectedValue.ToEntero(), TxtCorreoNotificaciones.Text, TxtObsAlmacen.Text, TxtPedidoContrato.Text, TxtOrdenCompra.Text, TxtFechaPago.Text, DdlUsoCFDI.SelectedValue.ToEntero, DescripcionVenta:=TxtDescripcionVenta.Text.Trim, - CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir) Then + CveMedico:=DdlMedico.SelectedValue.ToEntero, CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, FechaParaSurtir:=FechaParaSurtir, Paciente:=TxtPaciente.Text, + Episodio:=TxtEpisodio.Text) Then TieneError = True End If @@ -36092,6 +36107,7 @@ Partial Class Ventas TrVentasMedicas1.Visible = True TrVentasMedicas2.Visible = True + TrVentasMedicas3.Visible = True For Each item As ListItem In RBLTipoVenta.Items item.Text = $"  {item.Text}" @@ -36172,7 +36188,7 @@ Partial Class Ventas TdFechaOS1.Visible = ChkRequiereTecnico.Checked - TdFechaOS2.Visible = ChkRequiereTecnico.Checked + UpCliente.Update() End Sub @@ -36339,6 +36355,27 @@ Partial Class Ventas End If End If + + + For Each GvRow As GridViewRow In GvProductosProcedimiento.Rows + Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidad").Text.ToDecimal + Dim CveUnidadMedida As Integer = GvRow.DataKey("CveUnidadMedida").ToEntero + Dim Abreviatura As String = GvRow.DataKey("Abreviatura").ToString + Dim PU As Decimal = GvRow.DataKey("Precio").ToDecimal + Dim CveClasificacion As Integer = GvRow.DataKey("CveClasificacion").ToEntero + Dim Clasificacion As String = GvRow.DataKey("Clasificacion").ToString + Dim CvePS As Integer = GvRow.DataKey("CvePS").ToEntero + + If Cantidad > 0 Then + + If Not ValidaAgregarPS(CvePS, CveUnidadMedida, PU, 2) Then + Alert("No hay existencia.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + End If + Next + ChkRequiereTecnico.Checked = ChkRequiereTecnicoModal.Checked TxtFechaOS.Text = TxtFechaModal.Text @@ -36425,6 +36462,7 @@ Partial Class Ventas End If End If Next + If CountPsAgregados > 0 Then CalculaTotalesVenta() End If @@ -36492,7 +36530,8 @@ Partial Class Ventas If ObjOrdenServicio.AddOrdenesServicios(CveCliente, DdlSubProyectoDatos.SelectedValue.ToEntero, UsuarioActual.Nombre, TxtFechaOS.Text.Replace(",", "").ToDateTime, $"Venta: {LblSerie.Text}-{TxtFolio.Text}", UsuarioActual.CveUsuario, EstatusOrdenServicio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveVentaOS, -1, -1, CveOSTipo, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero, Direccion:="", Telefono:="", CveModeloAuto:=-1, Año:="", CveMedico:=DdlMedico.SelectedValue.ToEntero, - CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime) Then + CveProcedimiento:=DdlProcedimiento.SelectedValue.ToEntero, CveTipoVenta:=RBLTipoVenta.SelectedValue.ToEntero, FechaCita:=TxtFechaOS.Text.Replace(",", "").ToDateTime, + Paciente:=TxtPaciente.Text, IdentificadorCliente:=TxtEpisodio.Text) Then CveOSVentaMedica = ObjOrdenServicio.CveOS Else errorList.Add("Se presento un error al guardar la orden de servicio.") From 87e5151a57ea4424c1e3a747c70290b3a4fcff66 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Wed, 24 Jan 2024 16:15:34 -0700 Subject: [PATCH 04/15] SMS - 2024.01.23 OS en viar Solicitar paciente y Episodio --- App_Code/Modelos.vb | 5 ++++- OS/OrdenesServicios.aspx | 26 ++++++++++++++++++++++++-- OS/OrdenesServicios.aspx.vb | 26 ++++++++++++++++++++++++++ Ventas/Ventas.aspx.vb | 16 ++++++++++------ 4 files changed, 64 insertions(+), 9 deletions(-) diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 32bb6cb46..b9da573fd 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -2156,7 +2156,7 @@ Namespace Modelos CveMetodoPago33:=factura.CveMetodoPago33, CveUsoCFDI:=factura.CveUsoCFDI, OrdenCompra:=factura.OrdenCompra, CveCuentaTerminal:=factura.CveCuentaTerminal, CveTipoRelacion:=factura.CveTipoRelacion, ImpuestoLocal:=TotalImpuestoLocal, CveVentaRelacion:=(If(factura.CveVentaRelacion.ToEntero > 0, factura.CveVentaRelacion, -1)), ImporteRelacion:=(If(factura.ImporteRelacion <> Nothing, factura.ImporteRelacion, -1)), CveTipoAmortizacionAnticipo:=factura.CveTipoAmortizacionAnticipo, CveEmpresaCRM:=CveEmpresaCRM, EsInterno:=EsInterno, ServicioDomicilio:=factura.ServicioDomicilio, RFCReceptor:=RFCReceptor, EsGarantia:=factura.EsGarantia, DescripcionVenta:=factura.DescripcionVenta, - CveMedico:=factura.CveMedico, CveProcedimiento:=factura.CveProcedimiento, CveTipoVenta:=factura.CveTipoVenta, FechaParaSurtir:=factura.FechaParaSurtir) Then + CveMedico:=factura.CveMedico, CveProcedimiento:=factura.CveProcedimiento, CveTipoVenta:=factura.CveTipoVenta, FechaParaSurtir:=factura.FechaParaSurtir, Paciente:=factura.Paciente, Episodio:=factura.Episodio) Then ErrorList.Add("Ocurrió un error al Generar la Venta.
    Revise su factura y cualquier detalle comuníquese a Soporte Técnico") @@ -7647,6 +7647,9 @@ Namespace Modelos Public Property CveProcedimiento As Integer = -1 Public Property Procedimiento As String = "" Public Property CveTipoVenta As Integer = -1 + + Public Property Paciente As String = "" + Public Property Episodio As String = "" #End Region End Class diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index c71349af8..676c2cced 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -1283,7 +1283,28 @@ - diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 9f9985580..b1054773a 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -840,6 +840,12 @@ Partial Class Inventarios_EntradasSalidas LblFolioOrdenCorte.Text = DtMov.Rows(0)("FolioOrdendeCorte").ToString End If + If DtMov.Rows(0)("CveOS").ToString.ToEntero() > 0 Then + divOS.Visible = True + HplOS.Text = DtMov.Rows(0)("OSFolio").ToString + HplOS.NavigateUrl = $"/OS/OrdenesServicios.aspx?CveOS={DtMov.Rows(0)("CveOS")}" + End If + If (DdlAlmacen.Items.FindByValue(Mov.CveAlmacen.ToString()) Is Nothing) Then Dim dr As DataRow = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveEstatus:=-1).FiltroPrimero(String.Format("CveAlmacen = {0}", Mov.CveAlmacen)) From a0a820d94cdafee3709b2c79b15b952eb1116558 Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 25 Jan 2024 17:52:41 -0700 Subject: [PATCH 13/15] SMS - 2024.01.25 Ventas agregar Medico y procedimiento en modal --- App_Code/ClsVentas.vb | 11 +- OS/RepServicioDomicilio.aspx | 124 +---------------- UserControl/AddMedico.ascx | 197 +++++++++++++++++++++++++++ UserControl/AddMedico.ascx.vb | 187 +++++++++++++++++++++++++ UserControl/AddProcedimiento.ascx | 42 ++++++ UserControl/AddProcedimiento.ascx.vb | 81 +++++++++++ Ventas/CatMedicos.aspx | 6 +- Ventas/CatMedicos.aspx.vb | 55 ++++++-- Ventas/Ventas.aspx | 88 ++++++++---- Ventas/Ventas.aspx.vb | 57 +++++++- 10 files changed, 677 insertions(+), 171 deletions(-) create mode 100644 UserControl/AddMedico.ascx create mode 100644 UserControl/AddMedico.ascx.vb create mode 100644 UserControl/AddProcedimiento.ascx create mode 100644 UserControl/AddProcedimiento.ascx.vb diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 85ebb2554..d84a4c789 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -59,7 +59,7 @@ Public Class ClsVentas Public Property Neto As Double Public Property PorNeto As Double Public Property CveClasificacionDetalle As Integer - + Public Property CveMedicoNuevo As Integer = -1 #End Region @@ -6096,9 +6096,10 @@ Public Class ClsVentas Public Function AddMedico(Medico As String, CedulaProfesional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer, Telefono As String, Mail As String, CveMedicoEspecialidad As Integer, Celular As String, Consultorio As String, Optional CveMedicoSubEspecialidad As Integer = -1, - Optional Torre As String = "-1") As Boolean + Optional Torre As String = "-1") As Integer Dim Retorno As Boolean = False + CveMedicoNuevo = -1 DataAdapter("PA_Vta_MedicosAdd") With SqlAdapter.SelectCommand.Parameters @@ -6119,16 +6120,20 @@ Public Class ClsVentas .Add("@Consultorio", SqlDbType.VarChar).Value = Consultorio .Add("@CveMedicoSubEspecialidad", SqlDbType.Int).Value = CveMedicoSubEspecialidad .Add("@Torre", SqlDbType.VarChar).Value = Torre + .Add("@CveMedicoNuevo", SqlDbType.Int).Direction = ParameterDirection.Output + End With Try SqlAdapter.Fill(Data) + CveMedicoNuevo = SqlAdapter.SelectCommand.Parameters("@CveMedicoNuevo").Value.ToString.ToEntero Retorno = True Catch ex As Exception OnError("Ocurrió un error al guardar el Medico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try - Return Retorno + + Return CveMedicoNuevo End Function diff --git a/OS/RepServicioDomicilio.aspx b/OS/RepServicioDomicilio.aspx index bc80be8ec..e63fc3c5e 100644 --- a/OS/RepServicioDomicilio.aspx +++ b/OS/RepServicioDomicilio.aspx @@ -842,50 +842,12 @@ function selectDate(start, end, allDay) { - <%-- $('#ModalAgenda').modal('show'); - $("#SpanTituloAgenda").html("Agregar Evento"); - - $("#HdnCveEvento").val(-1); - - $("#DdlAgedaTipo").val("-1"); - $("#DdlPrioridad").val("1"); - - $("#TxtAsuntoAgenda").val(""); - $("#TxtDescripcionAgenda").val(""); - $("#TxtFechaInicioAgenda").val("" + start.format("DD/MM/YYYY 08:00")); - $("#TxtFechaFinAgenda").val("" + start.format("DD/MM/YYYY 09:00")); - - $("#UpRecurrencia").hide(); - $("#CheckRecurrencia").prop('checked', false); - - $get("HdnDiasSemanaAgendar").value = -1; - - $('#<%=RBLRecurrencia.ClientID %>').find("input[value='1']").prop("checked", true); - $('#<%=TrDiasSemanaAdd.ClientID %>').css("display", "none"); - $("#DivDescripcionUpdate").css("display", "none"); - $("#<%=TxtDescripcionAgenda.ClientID%>").css("display", "block"); - $('#<%=LblTextoFrecuencia.ClientID%>').html("Hora(s)"); - - $("#TxtFrecuencia").val("1"); - $("#TxtNumeroOcurrencias").val(""); - $("#TxtFechaFinRecurrencia").val(""); - - $("#ChkGastoRecurrente").prop('checked', false); - $("#TxtImporteGastoRecurrente").val("");--%> + } function updateEvent(event, element) { - - - - //$('#ModalAgenda').modal('show'); - - - // $get("HdnDiasSemanaAgendar").value = - - $('#<%=HFCveOS.ClientID%>').val(event.CveOS); @@ -895,89 +857,7 @@ $('#<%=HFOCveOIEvento.ClientID%>').val(event.id); $('#<%=LnkCommando.ClientID%>').click(); - -<%-- $("#DivDescripcionUpdate").css("display", "block"); - $("#<%=TxtDescripcionAgenda.ClientID%>").css("display", "none"); - $("#HdnCveEvento").val(event.id); - - $("#TxtNumeroOcurrencias").val(''); - $("#TxtFechaFinRecurrencia").val(''); - $("#TxtFrecuencia").val(''); - - $("#TxtAsuntoAgenda").val(event.title); - //SE MUESTRA EL TEXTO HTML EN EL DIV DE LA DESCRIPCION SIN PERMITIR EDITAR, - //SE ASIGNA -1 EN EL TEXBOX PARA QUE NO REALICE CAMBIOS EN BD - $("#DivDescripcionUpdate").html(event.description); - $("#TxtDescripcionAgenda").val("-1"); - - $("#DdlAgedaTipo").val(event.cveagendatipo); - $("#DdlPrioridad").val(event.prioridad); - $('#LblSubProyecto').text(event.SubProyecto); - $('#LblDireccion').text(event.Direccion); - - - - $("#TxtFechaInicioAgenda").val("" + event.start.format("DD/MM/YYYY HH:mm")); - - $("#TxtFechaFinAgenda").val("" + event.end.format("DD/MM/YYYY HH:mm")); - - //Identifica el tipo de Fecha Termino de la Recurrencia - if (event.recurrenciafin == 0) { - $("#TxtFrecuencia").val('0'); - } else if (!isNaN(event.recurrenciafin)) { - $("#RBNumeroOcurrencias").prop('checked', true); - $("#TxtNumeroOcurrencias").val(event.recurrenciafin); - } else { - $("#RBFechaFin").prop('checked', true); - $("#TxtFechaFinRecurrencia").val("" + event.recurrenciafin); - } - - //GASTO RECURRENTE - //Si el evento es tipo 10 = Gasto Mes, activa gasto recurrente - if (event.CveTipoEvento == 10) { - $("#ChkGastoRecurrente").prop('checked', true); - $("#TxtImporteGastoRecurrente").val(event.Importe); - } else { - $("#ChkGastoRecurrente").prop('checked', false); - $("#TxtImporteGastoRecurrente").val(''); - } - - //Verifica que hay Recurrencia para activar los campos y poner sus valores respectivos - if (event.recurrenciatipo > 0) { - $("#CheckRecurrencia").prop('checked', true); - - // CHECKEA EL TIPO DE RECURRENCIA QUE TENGA EL EVENTO - var text = event.recurrenciatipo; - var radio = $("[id*=RBLRecurrencia] label:contains('" + text + "')").closest("td").find("input"); - radio.attr("checked", "checked"); - - // CHECKEA LOS DIAS SELECCIONADOS DE LA RECURRENCIA DE SEMANA - $get("HdnDiasSemanaAgendar").value = event.diassemana; - - //LLENA TEXTO DE FRECUENCIA DE RECURRENCIA - $("#TxtFrecuencia").val("" + event.frecuencia); - } else { - $("#CheckRecurrencia").prop('checked', false); - } - - - //ESCONDE O MUESTRA EL DIV DE LAS OPCIONES DE RECURRENCIA - if ($get('CheckRecurrencia').checked) { - $("#UpRecurrencia").show(); - } else { - $("#UpRecurrencia").hide(); - } - - //LLAMA EL INDEXCHANGED DEL RADIOBUTTONLIST DE LOS TIPOS DE RECURRENCIA - $("#BtnActualizaAdd").click(); - - //Muestra nombre de la empresa si esta tarea sea asigno desde EmpresaCRM - if (event.EmpresaCRM != "") { - $("#<%=LblEmpresaCRM.ClientID%>").css("display", "") - $("#<%=LblEmpresaCRM.ClientID%>").text(event.EmpresaCRM); - } else { - $("#<%=LblEmpresaCRM.ClientID%>").css("display", "none") - }--%> + } function RadionButtonSelectedValueSet(name, SelectdValue) { diff --git a/UserControl/AddMedico.ascx b/UserControl/AddMedico.ascx new file mode 100644 index 000000000..754c018de --- /dev/null +++ b/UserControl/AddMedico.ascx @@ -0,0 +1,197 @@ +<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddMedico.ascx.vb" Inherits="UserControl_AddMedico" %> + +
    + +
    diff --git a/UserControl/AddMedico.ascx.vb b/UserControl/AddMedico.ascx.vb new file mode 100644 index 000000000..9cc57b4d1 --- /dev/null +++ b/UserControl/AddMedico.ascx.vb @@ -0,0 +1,187 @@ +Imports Extensiones + +Partial Class UserControl_AddMedico + Inherits System.Web.UI.UserControl + + Public ReadOnly Property UsuarioActual As Usuario + Get + If Context.Session("UsuarioSIG") Is Nothing Then + Return Nothing + Else + Return DirectCast(Context.Session("UsuarioSIG"), Usuario) + End If + End Get + End Property + + Public Property CveMedico As Integer + Get + If ViewState("CveMedico") Is Nothing Then + ViewState("CveMedico") = -1 + End If + Return ViewState("CveMedico").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveMedico") = value + End Set + End Property + + Private Sub UserControl_AddMedico_Load(sender As Object, e As EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + CargaEspecialidad() + CargaSubEspecialidad(-1) + End If + End Sub + + + Sub CargaEspecialidad() + Dim ObjVentas As New ClsVentas + + If ObjVentas.GetMedicosEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then + DdlEspecialidad.DataSource = ObjVentas.DtResultados + Else + DdlEspecialidad.DataSource = Nothing + End If + + ObjVentas.Dispose() + + DdlEspecialidad.DataBind() + DdlEspecialidad.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + + UpModal.Update() + + + End Sub + + + Sub CargaSubEspecialidad(CveMedicoEspecialidad As Integer) + Dim ObjVentas As New ClsVentas + + If ObjVentas.GetMedicosSubEspecialidades(-1, UsuarioActual.CveEmpresa, -1) Then + If CveMedicoEspecialidad > 0 Then + DdlSubEspecialidad.DataSource = ObjVentas.DtResultados.FiltraParametros($"CveMedicoEspecialidad = {CveMedicoEspecialidad}") + Else + DdlSubEspecialidad.DataSource = ObjVentas.DtResultados + End If + End If + + ObjVentas.Dispose() + + DdlSubEspecialidad.DataBind() + DdlSubEspecialidad.Items.Insert(0, New ListItem("Seleccione uno", "-1")) + UpModal.Update() + + End Sub + + Protected Sub DdlEspecialidad_SelectedIndexChanged(sender As Object, e As EventArgs) + CargaSubEspecialidad(DdlEspecialidad.SelectedValue.ToEntero) + End Sub + + + Public Sub LimpiarControles() + LbAgregar.Text = "Agregar" + LtlTituloModal.Text = "Agregar Médico" + + TxtMedico.Text = "" + TxtCedulaProfecional.Text = "" + TxtFechaNacimiento.Text = "" + TxtNotas.Text = "" + TxtDiasAtencion.Text = "" + TxtHorario.Text = "" + TxtLugar.Text = "" + TxtConsultorio.Text = "" + TxtMail.Text = "" + TxtTelefono.Text = "" + TxtCelular.Text = "" + DdlEspecialidad.SelectedValueExist(-1) + DdlSubEspecialidad.SelectedValueExist(-1) + TxtTorre.Text = "" + DVUsuarioFechaIng.Visible = False + TxtFechaIng.Text = "" + TxtUsuario.Text = "" + + + DVEstatus.Visible = False + ChkEstatus.Checked = True + + UpModal.Update() + CveMedico = -1 + End Sub + + Public Sub PreparaEdicion(CveMedicoEditar As Integer, Medico As String, CedulaProfecional As String, FechaNacimiento As Date, Notas As String, DiasAtencion As String, Horario As String, Lugar As String, Consultorio As String, Estatus As Boolean, + Mail As String, Telefono As String, Celular As String, CveMedicoEspecialidad As Integer, CveMedicoSubEspecialidad As Integer, Torre As String, FechaIng As DateTime, Usuario As String) + + + + CveMedico = CveMedicoEditar + + TxtMedico.Text = Medico + TxtCedulaProfecional.Text = CedulaProfecional + TxtFechaNacimiento.Text = FechaNacimiento.ToString("dd/MM/yyyy") + TxtNotas.Text = Notas + TxtDiasAtencion.Text = DiasAtencion + TxtHorario.Text = Horario + TxtLugar.Text = Lugar + TxtConsultorio.Text = Consultorio + ChkEstatus.Checked = Estatus + TxtMail.Text = Mail + TxtTelefono.Text = Telefono + TxtCelular.Text = Celular + DdlEspecialidad.SelectedValueExist(CveMedicoEspecialidad) + CargaSubEspecialidad(CveMedicoEspecialidad) + DdlSubEspecialidad.SelectedValueExist(CveMedicoSubEspecialidad) + TxtTorre.Text = Torre + + DVUsuarioFechaIng.Visible = True + TxtFechaIng.Text = FechaIng.ToString("dd/MM/yyyy hh:mm:ss tt") + TxtUsuario.Text = Usuario + + DVEstatus.Visible = True + LbAgregar.Text = "Actualizar" + LtlTituloModal.Text = $"Actualizar Médico {TxtCedulaProfecional.Text}" + + UpModal.Update() + + + End Sub + + Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click + Dim ProcesoOK = False + Dim ObjVentas As New ClsVentas + Dim CveMedicoNuevo As Integer = -1 + + + Dim Telefono As String = If(TxtTelefono.Text = "(___) ___-____", "", TxtTelefono.Text) + Dim Celular As String = If(TxtCelular.Text = "(___) ___-____", "", TxtCelular.Text) + + If CveMedico > 0 Then + If ObjVentas.UpdateMedico(CveMedico, TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked, + UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.Text.Trim) Then + ProcesoOK = True + End If + Else + + CveMedicoNuevo = ObjVentas.AddMedico(TxtMedico.Text.Trim, TxtCedulaProfecional.Text.Trim, TxtFechaNacimiento.Text.ToDate, TxtNotas.Text.Trim, TxtDiasAtencion.Text.Trim, TxtHorario.Text.Trim, TxtLugar.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, + UsuarioActual.CveEmpresa, Telefono, TxtMail.Text, DdlEspecialidad.SelectedValue.ToEntero, Celular, TxtConsultorio.Text.Trim, DdlSubEspecialidad.SelectedValue.ToEntero, TxtTorre.Text.Trim) + + If CveMedicoNuevo > 0 Then + ProcesoOK = True + End If + End If + + ObjVentas.Dispose() + + If ProcesoOK Then + ClsPaginas.Alert($"Medico {If(CveMedico > 0, "Actualizado", "Guardado")} Correctamente.") + Dim AppNombre As String = $"GlobalDTAgentes-{UsuarioActual.CveEmpresa}" + Application(AppNombre) = Nothing + RegistraScript($"fncRegargaMedicos({CveMedicoNuevo});") + RegistraScript("$('#BtnCancelarMedico').click();") + + End If + + + + End Sub + +End Class diff --git a/UserControl/AddProcedimiento.ascx b/UserControl/AddProcedimiento.ascx new file mode 100644 index 000000000..c828b5139 --- /dev/null +++ b/UserControl/AddProcedimiento.ascx @@ -0,0 +1,42 @@ +<%@ Control Language="VB" AutoEventWireup="false" CodeFile="AddProcedimiento.ascx.vb" Inherits="UserControl_AddProcedimiento" %> + +
    + +
    diff --git a/UserControl/AddProcedimiento.ascx.vb b/UserControl/AddProcedimiento.ascx.vb new file mode 100644 index 000000000..37b84465f --- /dev/null +++ b/UserControl/AddProcedimiento.ascx.vb @@ -0,0 +1,81 @@ +Imports Extensiones +Partial Class UserControl_AddProcedimiento + Inherits System.Web.UI.UserControl + + Public ReadOnly Property UsuarioActual As Usuario + Get + If Context.Session("UsuarioSIG") Is Nothing Then + Return Nothing + Else + Return DirectCast(Context.Session("UsuarioSIG"), Usuario) + End If + End Get + End Property + + Public Property CveProcedimiento As Integer + Get + If ViewState("CveProcedimiento") Is Nothing Then + ViewState("CveProcedimiento") = -1 + End If + Return ViewState("CveProcedimiento").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CveProcedimiento") = value + End Set + End Property + + + + Private Sub UserControl_AddProcedimiento_Load(sender As Object, e As EventArgs) Handles Me.Load + If Not Page.IsPostBack Then + + End If + End Sub + + + Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click + Dim ProcesoOK = False + Dim ObjVentas As New ClsVentas + Dim CveProcedimientoNuevo As Integer = -1 + + If CveProcedimiento > 0 Then + If ObjVentas.UpdateProcedimiento(CveProcedimiento, TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + 'Alert($"Procedimiento Actualizado Correctamente.") + ProcesoOK = True + End If + Else + + CveProcedimientoNuevo = ObjVentas.AddProcedimiento(TxtProcedimiento.Text.Trim, ChkEstatus.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + If CveProcedimientoNuevo > 0 Then + ProcesoOK = True + 'TabProductos.Visible = True + 'TabVentas.Visible = True + 'LnkAgregarProducto.Visible = True + 'UpDatos.Update() + 'Alert($"Procedimiento Guardado Correctamente.") + End If + + End If + + ObjVentas.Dispose() + + If ProcesoOK Then + ClsPaginas.Alert($"Procedimiento {If(CveProcedimiento > 0, "Actualizado", "Guardado")} Correctamente.") + Dim AppNombre As String = $"GlobalDTProcedimientos-{UsuarioActual.CveEmpresa}" + Application(AppNombre) = Nothing + RegistraScript($"fncRegargaProcedimientos({CveProcedimientoNuevo});") + RegistraScript("$('#BtnCancelarProcedimiento').click();") + + End If + + + + End Sub + + Public Sub LimpiarControles() + TxtProcedimiento.Text = "" + ChkEstatus.Checked = True + UpModal.Update() + End Sub + +End Class diff --git a/Ventas/CatMedicos.aspx b/Ventas/CatMedicos.aspx index 7d6d9c0c2..61bf3be6f 100644 --- a/Ventas/CatMedicos.aspx +++ b/Ventas/CatMedicos.aspx @@ -312,7 +312,7 @@ - + <%-- @@ -372,7 +372,7 @@ - + --%>
    @@ -383,7 +383,7 @@