CRM Mejoras
This commit is contained in:
@@ -29,5 +29,16 @@ Public Class CalendarEvent
|
||||
Public Property CveEmpresaCRM As String
|
||||
Public Property CveContactoCRM As String
|
||||
Public Property CveAcercamientoCRM As String
|
||||
Public Property NombreCliente As String
|
||||
Public Property NombreProveedor As String
|
||||
Public Property NomprePersonal As String
|
||||
Public Property NombreAcercamiento As String
|
||||
Public Property CvePersonal As Integer
|
||||
Public Property CveCliente As Integer
|
||||
Public Property CveProveedor As Integer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
@@ -358,7 +358,7 @@ Public Class ClsCRM
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function AddEtapaProceso(EtapaProceso As String, Descripcion As String, CveTipoEtapa As Integer, Orden As Integer, CveTipoProceso As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer) As Boolean
|
||||
Public Function AddEtapaProceso(EtapaProceso As String, Descripcion As String, CveTipoEtapa As Integer, Orden As Integer, CveTipoProceso As Integer, CveEmpresa As Integer, CveUsuarioIng As Integer, Optional EsCotizacion As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_CRM_EtapaProcesoAdd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -371,17 +371,26 @@ Public Class ClsCRM
|
||||
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveUsuarioIng", SqlDbType.Int).Value = CveUsuarioIng
|
||||
.Add("@EsCotizacion", SqlDbType.Bit).Value = EsCotizacion
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al agregar la Etapa al Proceso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
|
||||
If ex.Message.Contains("Ya existe una cotización en el proceso") Then
|
||||
Alert("Ya existe una cotización en el proceso", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
OnError("Ocurrió un error al agregar la Etapa al Proceso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
Public Function UpdateEtapaProceso(EtapaProceso As String, Descripcion As String, CveEstatus As Boolean, CveTipoEtapa As Integer, Orden As Integer, CveEtapaProceso As Integer) As Boolean
|
||||
Public Function UpdateEtapaProceso(EtapaProceso As String, Descripcion As String, CveEstatus As Boolean, CveTipoEtapa As Integer, Orden As Integer, CveEtapaProceso As Integer, Optional EsCotizacion As Boolean = False) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_CRM_EtapaProcesoUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
@@ -393,12 +402,19 @@ Public Class ClsCRM
|
||||
.Add("@Orden", SqlDbType.Int).Value = Orden
|
||||
|
||||
.Add("@CveEtapaProceso", SqlDbType.Int).Value = CveEtapaProceso
|
||||
.Add("@EsCotizacion", SqlDbType.Bit).Value = EsCotizacion
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar la Etapa del Proceso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
|
||||
If ex.Message.Contains("Ya existe una cotización en el proceso") Then
|
||||
Alert("Ya existe una cotización en el proceso", TipoMensaje.MsgAdvertencia)
|
||||
Else
|
||||
OnError("Ocurrió un error al actualizar la Etapa del Proceso.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
@@ -812,6 +828,26 @@ Public Class ClsCRM
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function UpdateAcercamientoCotizacion(cveAcercamiento As Integer, Importe As Decimal, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_CRM_AcercamientoCotizacionUpdate")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CveAcercamiento", SqlDbType.Int).Value = cveAcercamiento
|
||||
.Add("@Importe", SqlDbType.Money).Value = Importe
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al actualizar el Acercamiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
|
||||
Public Function RemoveAcercamiento(CveAcercamiento As Integer, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
DataAdapter("PA_CRM_AcercamientoRemove")
|
||||
@@ -1129,6 +1165,41 @@ Public Class ClsCRM
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Public Function RepAgendasBitacoras(CveEmpresa As Integer, CveVendedor As Integer, CveTipoProceso As Integer, FechaInicio As Date, FechaFin As Date) As Boolean
|
||||
Dim retorno As Boolean = False
|
||||
DataAdapter("PA_CRM_RepAgendasBitacoras", CommandType.StoredProcedure)
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
|
||||
.Add("@CveTipoProceso", SqlDbType.Int).Value = CveTipoProceso
|
||||
.Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
|
||||
.Add("@FechaFin", SqlDbType.Date).Value = FechaFin
|
||||
|
||||
|
||||
End With
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
retorno = True
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al obtener el Reporte de Agendas Bitácoras.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End Try
|
||||
Return retorno
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Asignar Vendedor a Prospectos"
|
||||
@@ -1266,5 +1337,7 @@ Public Class ClsCRM
|
||||
End Try
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
End Class
|
||||
|
||||
@@ -4919,6 +4919,7 @@ Public Class ClsPaginas
|
||||
'PaginaDict.Add("/CRM/Acercamiento.aspx".ToUpper(), 1308)
|
||||
PaginaDict.Add("/CRM/Acercamiento.aspx".ToUpper(), 1305)
|
||||
PaginaDict.Add("/CRM/RepAcercamientos.aspx".ToUpper(), 1311)
|
||||
PaginaDict.Add("/CRM/RepAgendasBitacoras.aspx".ToUpper(), 1333)
|
||||
PaginaDict.Add("/CRM/PopUpBuscarAcercamiento.aspx".ToUpper(), 1312)
|
||||
PaginaDict.Add("/CRM/RepAcercamientosProcesos.aspx".ToUpper(), 1313)
|
||||
PaginaDict.Add("/CRM/RepAcercamientosRechazos.aspx".ToUpper(), 1314)
|
||||
|
||||
@@ -133,6 +133,17 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState
|
||||
cevent.CveContactoCRM = dr("CveContactoCRM").ToString
|
||||
cevent.CveAcercamientoCRM = dr("CveAcercamientoCRM").ToString
|
||||
|
||||
cevent.CvePersonal = dr("CvePersonal").ToString.ToEntero
|
||||
cevent.CveCliente = dr("CveCliente").ToString.ToEntero
|
||||
cevent.CveProveedor = dr("CveProveedor").ToString.ToEntero
|
||||
|
||||
|
||||
|
||||
cevent.NombreCliente = dr("NombreCliente").ToString
|
||||
cevent.NombreProveedor = dr("NombreProveedor").ToString
|
||||
cevent.NomprePersonal = dr("NomprePersonal").ToString
|
||||
|
||||
cevent.NombreAcercamiento = dr("NombreAcercamiento").ToString
|
||||
|
||||
'11/05/2018 - Evento Gasto Recurrente
|
||||
cevent.CveTipoEvento = dr("CveTipoEvento").ToString.ToEntero
|
||||
|
||||
Binary file not shown.
@@ -417,14 +417,20 @@
|
||||
<i></i>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<div class="form-group form-md-line-input input-iconright" runat="server" id="DVEmpresaDdl" visible="true">
|
||||
<asp:DropDownList ID="DdlEmpresaCRM" DataTextField="Empresa" DataValueField="CveEmpresaCRM" CausesValidation="true" OnSelectedIndexChanged="DdlEmpresaCRM_SelectedIndexChanged" AutoPostBack="true" runat="server" Width="100%" AppendDataBoundItems="true" CssClass="form-control input-sm select2me"></asp:DropDownList>
|
||||
<label for="<%= DdlEmpresaCRM.ClientID.ToString()%>">Empresa:</label>
|
||||
<asp:RequiredFieldValidator ID="RFVEmpresaCRM" CssClass="help-block errorimput" runat="server" ControlToValidate="DdlEmpresaCRM" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Empresa''</b> es necesario." InitialValue="-1" ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group" runat="server" id="DVEmpresaLnk" visible="false" >
|
||||
<label for="<%= LnkEmpresaCRM.ClientID.ToString()%>" style="color:#888888">Empresa:</label>
|
||||
<asp:HyperLink runat="server" ID="LnkEmpresaCRM" target="_blank" CssClass="Texto" style="font-size:16px;margin-top:-10px!important"></asp:HyperLink>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlContactoPrincipal" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="NombreTipoContacto" DataValueField="CveContacto" Class="form-control input-sm select2me">
|
||||
<asp:DropDownList ID="DdlContactoPrincipal" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="NombreTipoTelCorreo" DataValueField="CveContacto" Class="form-control input-sm select2me">
|
||||
<asp:ListItem Value="-1" Text="Seleccione"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<label for="<%= DdlContactoPrincipal.ClientID.ToString()%>">Contacto Principal:</label>
|
||||
@@ -877,13 +883,13 @@
|
||||
<div runat="server" id="Div2" style="padding: 0 10px 10px 10px;">
|
||||
<asp:UpdatePanel runat="server" ID="UpCotizacion" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvCotizacion" runat="server" DataKeyNames="CveVenta,CveEmpresaCRM,CveAcercamientoCRM,CveEstatusFactura, EstatusFactura" EmptyDataText="Aún no se han registrado cotizaciones."
|
||||
<asp:GridView ID="GvCotizacion" runat="server" DataKeyNames="CveVenta,CveEmpresaCRM,CveAcercamientoCRM,CveEstatusFactura, EstatusFactura,Total" EmptyDataText="Aún no se han registrado cotizaciones."
|
||||
EmptyDataRowStyle-HorizontalAlign="Center" ToolTip="Listado de Cotizaciones" CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" AlternatingRowStyle-BorderStyle="None"
|
||||
GridLines="None" BorderColor="#D3D3D3" BorderWidth="1" AutoGenerateColumns="false" OnRowDataBound="GvCotizacion_RowDataBound">
|
||||
<Columns>
|
||||
<asp:HyperLinkField DataTextField="SerieFolio" Target="_blank" DataNavigateUrlFields="CveVenta" DataNavigateUrlFormatString="/Ventas/Ventas.aspx?CveVenta={0}" ItemStyle-HorizontalAlign="Left" HeaderText="Serie Folio" />
|
||||
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}" />
|
||||
<asp:BoundField DataField="Total" ItemStyle-HorizontalAlign="Right" HeaderText="Total" DataFormatString="{0:N2}" />
|
||||
<asp:BoundField DataField="Total" ItemStyle-HorizontalAlign="Right" HeaderText="Total" DataFormatString="{0:N1}" />
|
||||
|
||||
<asp:TemplateField HeaderText="Estatus" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
|
||||
@@ -291,6 +291,25 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
//public int RCveEvento { get { return ViewState["RCveEvento"] != null ? ViewState["RCveEvento"].ToString().ToEntero() : 0; } set { ViewState["RCveEvento"] = value; } }
|
||||
public System.Data.DataTable CheckListNew { get { return ViewState["CheckListNew"] != null ? (System.Data.DataTable)ViewState["CheckListNew"] : null; } set { ViewState["CheckListNew"] = value; } }
|
||||
public int chklistitemindex { get { return ViewState["chklistitemindex"] != null ? ViewState["chklistitemindex"].ToString().ToEntero() : 0; } set { ViewState["chklistitemindex"] = value; } }
|
||||
|
||||
|
||||
private long CveEtapaProcesoActualVal
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ViewState["CveEtapaProcesoActualVal"] == null)
|
||||
{
|
||||
ViewState["CveEtapaProcesoActualVal"] = -1;
|
||||
}
|
||||
return ViewState["CveEtapaProcesoActualVal"].ToString().ToEntero();
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["CveEtapaProcesoActualVal"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
@@ -383,6 +402,9 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
|
||||
//SECCION DATOS DEL PROCESO
|
||||
DdlEtapaProceso.SelectedValueExist(objAcercamiento.Result[0].CveEtapaProcesoActual);
|
||||
|
||||
CveEtapaProcesoActualVal = objAcercamiento.Result[0].CveEtapaProcesoActual;
|
||||
|
||||
DdlVendedor.SelectedValueExist(objAcercamiento.Result[0].CveVendedor);
|
||||
DdlMedioCaptacion.SelectedValueExist(objAcercamiento.Result[0].CveMedioCaptacion);
|
||||
|
||||
@@ -413,6 +435,19 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
BtnGuardarAcercamiento.Text = "Actualizar";
|
||||
BtnGuardarAcercamiento.Visible = true;
|
||||
BtnEliminarAcercamiento.Visible = true;
|
||||
|
||||
|
||||
if(DdlEmpresaCRM.SelectedValue.ToEntero() > 0)
|
||||
{
|
||||
LnkEmpresaCRM.NavigateUrl = $"~/CRM/EmpresaCRM.aspx?CveEmpresaCRM={DdlEmpresaCRM.SelectedValue}";
|
||||
|
||||
LnkEmpresaCRM.Text = DdlEmpresaCRM.SelectedItem.Text;
|
||||
|
||||
DVEmpresaDdl.Visible = false;
|
||||
DVEmpresaLnk.Visible = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
@@ -653,24 +688,90 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
}
|
||||
protected void DdlEtapaProceso_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (ActivaFechaCierre(DdlEtapaProceso.SelectedValue.ToEntero()))
|
||||
|
||||
if (ValidaEtapaCotizacion(DdlEtapaProceso.SelectedValue.ToEntero()))
|
||||
{
|
||||
TxtFechaCierre.Text = DateTime.Now.ToShortDateString();
|
||||
if (ActivaFechaCierre(DdlEtapaProceso.SelectedValue.ToEntero()))
|
||||
{
|
||||
TxtFechaCierre.Text = DateTime.Now.ToShortDateString();
|
||||
}
|
||||
else
|
||||
{
|
||||
TxtFechaCierre.Text = "";
|
||||
if (DTEtapasProceso.FiltraParametros(String.Format("CveEtapaProceso = {0} AND CveTipoEtapa = 4", DdlEtapaProceso.SelectedValue.ToEntero())).Rows.Count > 0)
|
||||
{
|
||||
LnkCerrarAcercamiento_Click(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
//AUTOGUARDADO DE CAMBIO DE ETAPA
|
||||
if (DTEtapasProceso.FiltroPrimeroValor("CveTipoEtapa", String.Format("CveEtapaProceso = {0}", DdlEtapaProceso.SelectedValue.ToEntero())).Contiene("1", "2", "3"))
|
||||
GuardarCambioEtapa();
|
||||
}
|
||||
else
|
||||
{
|
||||
TxtFechaCierre.Text = "";
|
||||
if (DTEtapasProceso.FiltraParametros(String.Format("CveEtapaProceso = {0} AND CveTipoEtapa = 4", DdlEtapaProceso.SelectedValue.ToEntero())).Rows.Count > 0)
|
||||
{
|
||||
LnkCerrarAcercamiento_Click(null, null);
|
||||
}
|
||||
DdlEtapaProceso.SelectedValueExist(CveEtapaProcesoActualVal);
|
||||
UPAcercamiento.Update();
|
||||
}
|
||||
|
||||
//AUTOGUARDADO DE CAMBIO DE ETAPA
|
||||
if (DTEtapasProceso.FiltroPrimeroValor("CveTipoEtapa", String.Format("CveEtapaProceso = {0}", DdlEtapaProceso.SelectedValue.ToEntero())).Contiene("1", "2", "3"))
|
||||
GuardarCambioEtapa();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private bool ValidaEtapaCotizacion(int CveEtapaProcesoValidar)
|
||||
{
|
||||
bool Respuesta = false;
|
||||
|
||||
int OrdenCotizacion = -1;
|
||||
int OrdenValidar = -1;
|
||||
|
||||
if(DTEtapasProceso.FiltraParametros(" EsCotizacion = 'true' ").Rows.Count == 1)
|
||||
{
|
||||
OrdenCotizacion = DTEtapasProceso.FiltroPrimeroValor("Orden", " EsCotizacion = 'true' ").ToEntero();
|
||||
OrdenValidar = DTEtapasProceso.FiltroPrimeroValor("Orden", $" CveEtapaProceso = {CveEtapaProcesoValidar} ").ToEntero();
|
||||
|
||||
if(OrdenValidar > OrdenCotizacion)
|
||||
{
|
||||
IVentaService ventaService = new VentaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestVentas requestVentas = new RequestVentas(UsuarioActual.CveEmpresa, TipoDocto: "Cot", CveEmpresaCRM: CveEmpresaCRM, CveUsuarioConsulta: UsuarioActual.CveUsuario, CveAcercamientoCRM: CveAcercamiento);
|
||||
var objVentas = ventaService.GetVentas(requestVentas);
|
||||
|
||||
if (objVentas.IsSuccess)
|
||||
{
|
||||
if(objVentas.Result.Count > 0)
|
||||
{
|
||||
CveEtapaProcesoActualVal = CveEtapaProcesoValidar;
|
||||
Respuesta = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Se require una cotización para continuar a la etapa seleccionada.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
Respuesta = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Alert("No se pudo validar el cambio de etapa", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
Respuesta = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Respuesta = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Respuesta = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return Respuesta;
|
||||
}
|
||||
|
||||
private void CargarPS()
|
||||
{
|
||||
DdlPS.setEsWebService(true);
|
||||
@@ -1750,7 +1851,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
#region "TAB COTIZACIONES"
|
||||
protected void CargaCotizaciones()
|
||||
{
|
||||
ClsVentas ObjVentas = new ClsVentas();
|
||||
|
||||
IVentaService ventaService = new VentaService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestVentas requestVentas = new RequestVentas(UsuarioActual.CveEmpresa, TipoDocto: "Cot", CveEmpresaCRM: CveEmpresaCRM, CveUsuarioConsulta: UsuarioActual.CveUsuario, CveAcercamientoCRM: CveAcercamiento);
|
||||
var objVentas = ventaService.GetVentas(requestVentas);
|
||||
@@ -1760,7 +1861,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
GvCotizacion.DataSource = objVentas.Result;
|
||||
TieneCotizacion = objVentas.Result.Count > 0;
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
|
||||
GvCotizacion.DataBind();
|
||||
UpCotizacion.Update();
|
||||
|
||||
@@ -1774,6 +1875,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
if (e.Row.DataKey("CveEstatusFactura").ToEntero() > 0)
|
||||
{
|
||||
e.Row.FCLabel("lblEstatus").Text = String.Format("<b>{0}</b>", e.Row.DataKey("EstatusFactura"));
|
||||
e.Row.Cells[2].Text = e.Row.DataKey("Total").ToDecimal().ToString("###,###,###.00");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GVDatos" runat="server" DataKeyNames="CveEtapaProceso, EtapaProceso, Descripcion, CveTipoProceso, TipoProceso, Estatus, CveEstatus, CveTipoEtapa, TipoEtapa, Orden, UsuarioIng, CveUsuarioIng, FechaIng" EmptyDataText="No se han registrado Etapas"
|
||||
<asp:GridView ID="GVDatos" runat="server" DataKeyNames="CveEtapaProceso, EtapaProceso, Descripcion, CveTipoProceso, TipoProceso, Estatus, CveEstatus, CveTipoEtapa, TipoEtapa, Orden, UsuarioIng, CveUsuarioIng, FechaIng,EsCotizacion,StrEsCotizacion" EmptyDataText="No se han registrado Etapas"
|
||||
EmptyDataRowStyle-HorizontalAlign="Center" CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" data-sort="true"
|
||||
GridLines="None" AutoGenerateColumns="false" OnRowDeleting="GVDatos_RowDeleting" OnRowDataBound="GVDatos_RowDataBound">
|
||||
<Columns>
|
||||
@@ -103,6 +103,13 @@
|
||||
<asp:Label ID="lblEstatus" runat="server" Text='<%# Eval("Estatus")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Cotización" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblEsCotizacion" runat="server" Text='<%# Eval("StrEsCotizacion")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:BoundField DataField="FechaIng" ItemStyle-Width="15%" HeaderText="Fecha de Ingreso" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:g}" />
|
||||
<asp:TemplateField HeaderText="Usuario que Ingresó" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
@@ -165,6 +172,13 @@
|
||||
<label for="<%= TxtDescripcion.ClientID.ToString()%>">Descripción:</label>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" id="Div1" runat="server">
|
||||
<label runat="server" id="LblEsCotizacion" for="<%= ChkEsCotizacion.ClientID.ToString()%>">Cotizacion:</label>
|
||||
<asp:CheckBox ID="ChkEsCotizacion" runat="server" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright" id="DivEstatus" runat="server">
|
||||
<label runat="server" id="lblEstatus" for="<%= ChkEstatus.ClientID.ToString()%>">Estatus:</label>
|
||||
<asp:CheckBox ID="ChkEstatus" runat="server" />
|
||||
|
||||
@@ -152,6 +152,7 @@ public partial class CRM_CatEtapasProceso : ClsPaginas
|
||||
TxtEtapaProceso.Text = "";
|
||||
TxtDescripcion.Text = "";
|
||||
ChkEstatus.Checked = true;
|
||||
ChkEsCotizacion.Checked = false;
|
||||
UPModal.Update();
|
||||
}
|
||||
|
||||
@@ -234,6 +235,8 @@ public partial class CRM_CatEtapasProceso : ClsPaginas
|
||||
TxtEtapaProceso.Text = GvRow.DataKey("EtapaProceso").ToString();
|
||||
TxtDescripcion.Text = GvRow.DataKey("Descripcion").ToString();
|
||||
ChkEstatus.Checked = GvRow.DataKey("CveEstatus").ToString() == "True" ? true : false;
|
||||
ChkEsCotizacion.Checked = GvRow.DataKey("EsCotizacion").ToString() == "True" ? true : false;
|
||||
|
||||
|
||||
CargaDdlOrden(GvRow.DataKey("CveTipoProceso").ToEntero());
|
||||
|
||||
@@ -293,7 +296,7 @@ public partial class CRM_CatEtapasProceso : ClsPaginas
|
||||
int CveUsuarioIng = UsuarioActual.CveUsuario;
|
||||
if (EsEditar == 0)
|
||||
{
|
||||
if (ObjCRM.AddEtapaProceso(EtapaProceso, Descripcion, CveTipoEtapa, Orden, CveTipoProceso, UsuarioActual.CveEmpresa, CveUsuarioIng))
|
||||
if (ObjCRM.AddEtapaProceso(EtapaProceso, Descripcion, CveTipoEtapa, Orden, CveTipoProceso, UsuarioActual.CveEmpresa, CveUsuarioIng, EsCotizacion:ChkEsCotizacion.Checked))
|
||||
{
|
||||
Alert(String.Format("La Etapa fue creada correctamente para el proceso {0}.", DdlTipoProceso.SelectedItem), ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
@@ -302,7 +305,7 @@ public partial class CRM_CatEtapasProceso : ClsPaginas
|
||||
{
|
||||
Orden = Estatus ? DdlOrden.SelectedValue.ToEntero() : -1;
|
||||
|
||||
if (ObjCRM.UpdateEtapaProceso(EtapaProceso, Descripcion, Estatus, CveTipoEtapa, Orden, CveEtapaProceso))
|
||||
if (ObjCRM.UpdateEtapaProceso(EtapaProceso, Descripcion, Estatus, CveTipoEtapa, Orden, CveEtapaProceso, EsCotizacion: ChkEsCotizacion.Checked))
|
||||
{
|
||||
Alert("La Etapa fue actualizada correctamente.", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.ADScroller-body {
|
||||
/* .ADScroller-body {
|
||||
max-height: 140px !important;
|
||||
}
|
||||
}*/
|
||||
|
||||
.ADScroller-footer {
|
||||
visibility: hidden;
|
||||
@@ -270,29 +270,35 @@
|
||||
<div runat="server" id="DivContactos" style="padding: 0 10px 10px 10px;">
|
||||
<asp:UpdatePanel runat="server" ID="UpContactos" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GVContactos" runat="server" DataKeyNames="CveContacto,Nombre,TelefonoOficina,Celular,Correo,CveUsuarioIng,FechaIng,CveTipoContacto" EmptyDataText="Aún no se han registrado contactos"
|
||||
<asp:GridView ID="GVContactos" runat="server" DataKeyNames="CveContacto,Nombre,TelefonoOficina,Celular,Correo,CveUsuarioIng,FechaIng,CveTipoContacto,TelExt,CveContactoSuperior" EmptyDataText="Aún no se han registrado contactos"
|
||||
EmptyDataRowStyle-HorizontalAlign="Center" ToolTip="Listado de Contactos" CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn" AlternatingRowStyle-BorderStyle="None"
|
||||
GridLines="None" BorderColor="#D3D3D3" BorderWidth="1" OnRowDeleting="GVContactos_RowDeleting" AutoGenerateColumns="false" OnRowDataBound="GVContactos_RowDataBound">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Nombre" ItemStyle-Width="30%" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlNombreContacto" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>
|
||||
<%-- <asp:Literal ID="LtlNombreContacto" runat="server" Text='<%# Eval("Nombre", "{0}") %>'></asp:Literal>--%>
|
||||
<asp:LinkButton ID="LnkNombreContacto" runat="server" Text='<%# Eval("Nombre", "{0}") %>' OnClick="LnkNombreContactoAgenda_Click" ></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField HeaderText="Tipo Contacto" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField HeaderText="Tipo Contacto" ItemStyle-Width="7%" HeaderStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="LtlTipoContacto" runat="server" Text='<%# Eval("TipoContacto", "{0}") %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
<ItemStyle HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Teléfono Oficina" ItemStyle-HorizontalAlign="Left">
|
||||
<asp:TemplateField ItemStyle-Width="7%" HeaderText="Teléfono Oficina" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblTelefonoOficina" runat="server" Text='<%# Eval("TelefonoOficina")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField ItemStyle-Width="4%" HeaderText="Tel. Ext." ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LblTelExt" runat="server" Text='<%# Eval("TelExt")%>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="15%" HeaderText="Celular" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
@@ -302,6 +308,8 @@
|
||||
|
||||
<asp:BoundField ItemStyle-Width="25%" DataField="Correo" HeaderText="Correo" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:BoundField DataField="ContactoSuperior" HeaderText="Contacto Superior" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<asp:TemplateField ItemStyle-Width="10%" HeaderText="Comandos" ItemStyle-HorizontalAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="LnkEditarContacto" runat="server" OnClick="LnkEditarContacto_Click" AlternateText="Editar" CommandArgument='<%# Eval("CveContacto")%>' CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||
@@ -574,13 +582,22 @@
|
||||
<label for="<%= TxtNombreContacto.ClientID.ToString()%>">Nombre del Contacto:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtTelefonoOficina" MaxLength="10" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:MaskedEditExtender ID="MEETelefonoOficina" runat="server" TargetControlID="TxtTelefonoOficina" Mask="(999)-999-9999" InputDirection="LeftToRight" MessageValidatorTip="true" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
|
||||
<%--<asp:RequiredFieldValidator ID="RFVTelefonoOficina" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTelefonoOficina" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono de Oficina''</b> es necesario, por favor ingréselo." ValidationGroup="VGGuardarContacto"></asp:RequiredFieldValidator>--%>
|
||||
<label for="<%= TxtTelefonoOficina.ClientID.ToString()%>">Teléfono de Oficina:</label>
|
||||
<div class="row">
|
||||
<div class="form-group form-md-line-input input-iconright col-md-5">
|
||||
<asp:TextBox ID="TxtTelefonoOficina" MaxLength="10" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:MaskedEditExtender ID="MEETelefonoOficina" runat="server" TargetControlID="TxtTelefonoOficina" Mask="(999)-999-9999" InputDirection="LeftToRight" MessageValidatorTip="true" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
|
||||
<%--<asp:RequiredFieldValidator ID="RFVTelefonoOficina" runat="server" CssClass="help-block errorimput" ControlToValidate="TxtTelefonoOficina" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Teléfono de Oficina''</b> es necesario, por favor ingréselo." ValidationGroup="VGGuardarContacto"></asp:RequiredFieldValidator>--%>
|
||||
<label for="<%= TxtTelefonoOficina.ClientID.ToString()%>">Teléfono de Oficina:</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright col-md-5">
|
||||
<asp:TextBox ID="TxtTelExt" MaxLength="5" CssClass="form-control" runat="server"></asp:TextBox>
|
||||
<label for="<%= TxtTelExt.ClientID.ToString()%>">Teléfono Extensión:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtCelular" MaxLength="10" CssClass="form-control" runat="server" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:MaskedEditExtender ID="MEE" runat="server" TargetControlID="TxtCelular" Mask="(999)-999-9999" InputDirection="LeftToRight" MessageValidatorTip="true" ErrorTooltipEnabled="True"></ajax:MaskedEditExtender>
|
||||
@@ -602,6 +619,12 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlContactoSuperior" runat="server" DataTextField="NombreTipoContacto" DataValueField="CveContacto" CssClass="form-control select2me" Width="50%"></asp:DropDownList>
|
||||
<label for="<%= DdlContactoSuperior.ClientID.ToString()%>">Contacto Superior:</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:Button ID="BtnGuardarContacto" OnClick="BtnGuardarContacto_Click" runat="server" Text="Guardar" CssClass="btn btn-primary mysmallbtn" ValidationGroup="VGGuardarContacto" />
|
||||
@@ -942,6 +965,63 @@
|
||||
</div>
|
||||
<%-- FIN MODAL BITACORA --%>
|
||||
|
||||
|
||||
|
||||
<%--INICIO MODAL CONTACTO AGENDA--%>
|
||||
|
||||
|
||||
<div id="DVModalContactoAgenda" class="modal ADS fade" role="dialog">
|
||||
<asp:UpdatePanel class="modal-dialog" runat="server" ID="UpModalContactoAgenda" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="modal-dialog" style="width:800px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title"><asp:Label runat="server" ID="LblModalContactoAgendaTitulo"></asp:Label></h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:GridView ID="GvContactoAgenda" runat="server"
|
||||
DataKeyNames="CveContacto,Nombre,CveEvento,FechaIng,CveEmpresa,FechaInicio,FechaFin,AsuntoDescripcion,CveTipoEvento,TipoEvento,CveUsuarioIng, Usuario"
|
||||
EmptyDataText="No se encontraron Registros"
|
||||
EmptyDataRowStyle-HorizontalAlign="Center" ToolTip="Agenda/Bitácora" CssClass="table table-striped table-advance table-hover ScrollAD Widthall mysmallbtn"
|
||||
AlternatingRowStyle-BorderStyle="None" GridLines="None" BorderColor="#D3D3D3" BorderWidth="1" AutoGenerateColumns="false" >
|
||||
<Columns>
|
||||
|
||||
<asp:BoundField DataField="TipoEvento" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" DataFormatString="{0:dd/MM/yyyy}" />
|
||||
<asp:BoundField DataField="AsuntoDescripcion" HeaderText="Descripción" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
<%--<asp:BoundField DataField="FechaInicio" HeaderText="Fecha Inicio." ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaFin" HeaderText="Fecha Fin" ItemStyle-HorizontalAlign="Left" />--%>
|
||||
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%--FIN MODAL CONTACTO AGENDA--%>
|
||||
|
||||
<%-- FIN MODALES --%>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
|
||||
@@ -893,6 +893,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
|
||||
protected void EliminarEmpresa()
|
||||
{
|
||||
string ErrorEliminacionEmpresa = "";
|
||||
Boolean HuboError = true;
|
||||
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
@@ -916,12 +917,19 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
var responseModelRemoveEncuestaAplicada = encuestaService.RemoveEncuestaAplicada(new RequestEncuestaAplicadaRemove() { CveEmpresa = UsuarioActual.CveEmpresa, CveEncuestaAplicada = CveEncuestaAplicada });
|
||||
if (CveEncuestaAplicada > 0 && !responseModelRemoveEncuestaAplicada.IsSuccess)
|
||||
{
|
||||
HuboError = true;
|
||||
HuboError = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HuboError = true;
|
||||
|
||||
|
||||
if (cRMService.Mensaje != null && cRMService.Mensaje != "")
|
||||
{
|
||||
ErrorEliminacionEmpresa = cRMService.Mensaje;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -943,7 +951,18 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
else
|
||||
{
|
||||
ObjCRM.RollBack();
|
||||
Alert("Ocurrio un error al intentar eliminar la empresa.", ModExtensiones.TipoMensaje.MsgError);
|
||||
|
||||
if(ErrorEliminacionEmpresa.Trim().Length > 0 && ErrorEliminacionEmpresa.Contains("547;"))
|
||||
{
|
||||
Alert("No se puede eliminar la empresa debido a que tiene registros realcionados.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert("Ocurrio un error al intentar eliminar la empresa.", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1003,6 +1022,8 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
TempDTContactos = null;
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestContactoEmpresaCRM contactoEmpresaCRM = new RequestContactoEmpresaCRM(CveEmpresaCRM, UsuarioActual.CveEmpresa, -1);
|
||||
|
||||
|
||||
var objCRM = cRMService.GetContactosEmpresasCRM(contactoEmpresaCRM);
|
||||
if (objCRM.Result.Count > 0)
|
||||
{
|
||||
@@ -1039,9 +1060,11 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
}
|
||||
TxtNombreContacto.Text = "";
|
||||
TxtTelefonoOficina.Text = "";
|
||||
TxtTelExt.Text = "";
|
||||
TxtCelular.Text = "";
|
||||
TxtCorreo.Text = "";
|
||||
DdlTipocontacto.SelectedValueExist(-1);
|
||||
DdlContactoSuperior.SelectedValueExist(-1);
|
||||
}
|
||||
|
||||
protected void BtnAgregarContacto_Click(object sender, EventArgs e)
|
||||
@@ -1051,26 +1074,29 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
UPModalContacto.Update();
|
||||
|
||||
CargaGridTipoContacto();
|
||||
CargaContactoSuperior(-1);
|
||||
|
||||
this.RegistraScript("$('#DivModalContacto').modal();");
|
||||
}
|
||||
|
||||
protected void LnkEditarContacto_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
CveContactoEditado = GvRow.DataKey("CveContacto").ToEntero();
|
||||
|
||||
CargaGridTipoContacto();
|
||||
CargaContactoSuperior(CveContactoEditado);
|
||||
|
||||
EsEditarContacto = true;
|
||||
limpiarCamposModalContato();
|
||||
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
|
||||
CveContactoEditado = GvRow.DataKey("CveContacto").ToEntero();
|
||||
limpiarCamposModalContato();
|
||||
|
||||
TxtNombreContacto.Text = GvRow.DataKey("Nombre").ToString();
|
||||
TxtTelefonoOficina.Text = GvRow.DataKey("TelefonoOficina").ToString();
|
||||
TxtTelExt.Text = GvRow.DataKey("TelExt").ToString();
|
||||
TxtCelular.Text = GvRow.DataKey("Celular").ToString();
|
||||
TxtCorreo.Text = GvRow.DataKey("Correo").ToString();
|
||||
DdlTipocontacto.SelectedValueExist( GvRow.DataKey("CveTipoContacto").ToString());
|
||||
DdlContactoSuperior.SelectedValueExist(GvRow.DataKey("CveContactoSuperior").ToString());
|
||||
|
||||
IndexDTContacto = GvRow.RowIndex;
|
||||
|
||||
@@ -1087,6 +1113,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
|
||||
String NombreContacto = TxtNombreContacto.Text;
|
||||
String TelefonoOficina = TxtTelefonoOficina.Text == "" ? "-1" : TxtTelefonoOficina.Text;
|
||||
String TelExt = TxtTelExt.Text == "" ? "-1" : TxtTelExt.Text;
|
||||
String Celular = TxtCelular.Text == "" ? "-1" : TxtCelular.Text;
|
||||
String Correo = TxtCorreo.Text == "" ? "-1" : TxtCorreo.Text;
|
||||
|
||||
@@ -1107,15 +1134,18 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
{
|
||||
contacto.Nombre = NombreContacto;
|
||||
contacto.TelefonoOficina = TelefonoOficina;
|
||||
contacto.TelExt = TelExt;
|
||||
contacto.Celular = Celular;
|
||||
contacto.Correo = Correo;
|
||||
contacto.CveEmpresaCRM = CveEmpresaCRM;
|
||||
contacto.CveUsuarioIng = CveUsuarioIng;
|
||||
contacto.CveTipoContacto = DdlTipocontacto.SelectedValue.ToEntero();
|
||||
contacto.CveContactoSuperior = DdlContactoSuperior.SelectedValue.ToEntero();
|
||||
|
||||
if (cRMService.EmpresasCRMContactoAdd(contacto))
|
||||
{
|
||||
TelefonoOficina = (TelefonoOficina != "-1" ? String.Format(", Teléfono de Oficina: {0:(###) ###-####}", Convert.ToInt64(TelefonoOficina)) : "");
|
||||
TelExt = (TelExt != "-1" ? String.Format(", Teléfono extensión: {0}", TelExt):"");
|
||||
Celular = (Celular != "-1" ? String.Format(", Celular: {0:(###) ###-####}", Convert.ToInt64(Celular)) : "");
|
||||
Correo = (Correo != "-1" ? String.Format(", Correo: {0}", Correo) : "");
|
||||
|
||||
@@ -1139,11 +1169,13 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
{
|
||||
contacto.Nombre = NombreContacto;
|
||||
contacto.TelefonoOficina = TelefonoOficina;
|
||||
contacto.TelExt = TelExt;
|
||||
contacto.Celular = Celular;
|
||||
contacto.Correo = Correo;
|
||||
contacto.CveContacto = CveContactoEditado;
|
||||
contacto.CveUsuarioIng = CveUsuarioIng;
|
||||
contacto.CveTipoContacto = DdlTipocontacto.SelectedValue.ToEntero();
|
||||
contacto.CveContactoSuperior = DdlContactoSuperior.SelectedValue.ToEntero();
|
||||
|
||||
if (cRMService.EmpresasCRMContactoUpdate(contacto))
|
||||
{
|
||||
@@ -1265,6 +1297,33 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
e.Row.FCLabel("lblCelular").Text = String.Format("{0:(###) ###-####}", Convert.ToInt64(e.Row.DataKey("Celular")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void LnkNombreContactoAgenda_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer);
|
||||
//CveContacto,Nombre,TelefonoOficina,Celular,Correo,CveUsuarioIng,FechaIng,CveTipoContacto
|
||||
int CveContacto = GvRow.DataKey("CveContacto").ToEntero();
|
||||
string NombreContacto = GvRow.DataKey("Nombre");
|
||||
|
||||
TempDTContactos = null;
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestContactoEmpresaCRM contactoEmpresaCRM = new RequestContactoEmpresaCRM(CveEmpresaCRM, UsuarioActual.CveEmpresa, CveContacto);
|
||||
|
||||
|
||||
var objCRM = cRMService.GetContactosEmpresaAgendaCRM(contactoEmpresaCRM);
|
||||
|
||||
if (objCRM.Result.Count > 0)
|
||||
{
|
||||
GvContactoAgenda.DataSource = objCRM.Result.ToDataTable();
|
||||
GvContactoAgenda.DataBind();
|
||||
|
||||
UpModalContactoAgenda.Update();
|
||||
LblModalContactoAgendaTitulo.Text = $"Agenda: {NombreContacto}";
|
||||
RegistraScript("$('#DVModalContactoAgenda').modal('show');");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region "BITACORA"
|
||||
@@ -1904,7 +1963,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
protected void LnkAgregartipoContacto_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
CargaGridTipoContacto();
|
||||
CargaGridTipoContacto();
|
||||
RegistraScript("$('#DivModalTipoContacto').modal('show');");
|
||||
}
|
||||
|
||||
@@ -1943,6 +2002,26 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
|
||||
cRMService = null;
|
||||
}
|
||||
|
||||
private void CargaContactoSuperior(int CveConcactoOmitir)
|
||||
{
|
||||
|
||||
DdlContactoSuperior.Items.Clear();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestContactoEmpresaCRM contactoEmpresaCRM = new RequestContactoEmpresaCRM(CveEmpresaCRM, UsuarioActual.CveEmpresa,-1);
|
||||
var objcontactoEmpresa = cRMService.GetContactosEmpresasCRM(contactoEmpresaCRM);
|
||||
|
||||
if (objcontactoEmpresa.Result.Count > 0)
|
||||
{
|
||||
DdlContactoSuperior.DataSource = objcontactoEmpresa.Result.ToDataTable().FiltraParametros((CveConcactoOmitir>0 ?$" CveContacto <> {CveConcactoOmitir} ": "" ));
|
||||
DdlContactoSuperior.DataBind();
|
||||
}
|
||||
DdlContactoSuperior.Items.Insert(0, new ListItem("Sin Asignar ", "-1"));
|
||||
|
||||
UPModalContacto.Update();
|
||||
|
||||
|
||||
}
|
||||
protected void btnAgregarTipoContacto_Click(object sender, EventArgs e)
|
||||
{
|
||||
bool ErrorProceso = false;
|
||||
@@ -1962,7 +2041,7 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
|
||||
if (!ErrorProceso)
|
||||
{
|
||||
CargaGridTipoContacto();
|
||||
CargaGridTipoContacto();
|
||||
LimpiaTipoContacto();
|
||||
}
|
||||
}
|
||||
@@ -2001,4 +2080,6 @@ public partial class CRM_EmpresaCRM : ClsPaginas
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
125
CRM/RepAgendasBitacoras.aspx
Normal file
125
CRM/RepAgendasBitacoras.aspx
Normal file
@@ -0,0 +1,125 @@
|
||||
<%@ Page Title="Reporte de Agendas Bitácoras" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepAgendasBitacoras.aspx.cs" Inherits="CRM_AgendasBitacoras" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
Reporte de Agendas Bitácoras
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel ID="UpAcciones" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton ID="LnkExcel" OnClick="LnkExcel_Click" runat="server" Text="<i class='fa fa-file-excel-o' style='font-weight:bold;'></i> Excel" ></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="LnkExcel" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div id="DivFiltros" class="portlet solid grey-cascade portlet-filter" id="dvFiltros">
|
||||
<div class="portlet-title portlet-filterT smalltitle">
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" OnClick="BtnConsultar_Click" class="btn btn-primary" ValidationGroup="Valida" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
|
||||
<div class="titlefiltros caption">
|
||||
<div class="row" style="margin-left: 10px;">
|
||||
|
||||
<label class="col-md-1" >Tipo Proceso:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlTipoProceso" Width="100%" runat="server" CssClass="form-control input-sm select2me" DataTextField="TipoProceso" DataValueField="CveTipoProceso">
|
||||
</asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 " >Vendedor:</label>
|
||||
<div class="col-md-1">
|
||||
<asp:DropDownList ID="DdlVendedor" runat="server" Width="100%" AppendDataBoundItems="true" DataTextField="Vendedor" DataValueField="CveVendedor" Class="table-group-action-input form-control input-inline input-small input-sm select2me"></asp:DropDownList>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 " >Fecha Inicio:</label>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="TxtFechaInicio" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaSolicitudI" runat="server" TargetControlID="TxtFechaInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaSolicitudI" TargetControlID="TxtFechaInicio" PopupButtonID="imgFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
|
||||
<label class="col-md-1 " >Fecha Fin:</label>
|
||||
<div class="col-md-1">
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 100px !important; padding: 0px; margin-bottom: -10px;">
|
||||
<asp:TextBox ID="TxtFechaFin" runat="server" CssClass="form-control" CausesValidation="true" Width="98%" MaxLength="10"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="imgFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFechaSolicitudF" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFechaSolicitudF" TargetControlID="TxtFechaFin" PopupButtonID="imgFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
<div class="row" style="margin-left: 10px; margin-top: 10px;">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
<asp:UpdatePanel ID="UPDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row" style="margin-left: 0px; margin-top: 15px; margin-bottom: 5px; text-align: right; margin-right: 5px;" align="left">
|
||||
<input type="text" id="TxtBusqueda" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda','{0}')", GVDatos.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||
</div>
|
||||
<asp:GridView ID="GVDatos" runat="server" DataKeyNames="Empresa,CveEmpresaCRM,NombreAcercamiento,CveAcercamiento,CveContactoPrincipal,NombreContacto,FechaIng,TipoEvento,AsuntoDescripcion,CveUsuarioIng,Usuario"
|
||||
AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros con los filtros especificados" CssClass="table table-striped table-advance table-hover Widthall mysmallbtn ScrollAD" data-sort="true" GridLines="None"
|
||||
EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="GVDatos_RowDataBound">
|
||||
<Columns>
|
||||
|
||||
<asp:HyperLinkField DataNavigateUrlFields="CveEmpresaCRM" DataNavigateUrlFormatString="EmpresaCRM.aspx?CveEmpresaCRM={0}" DataTextField="Empresa" HeaderText="Prospecto" ItemStyle-HorizontalAlign="Left" Target="_blank" />
|
||||
<asp:HyperLinkField DataNavigateUrlFields="CveAcercamiento" DataNavigateUrlFormatString="Acercamiento.aspx?CveAcercamiento={0}" DataTextField="NombreAcercamiento" HeaderText="Acercamineto/Oportunidad" ItemStyle-HorizontalAlign="Left" Target="_blank" />
|
||||
<asp:BoundField DataField="NombreContacto" HeaderText="Contacto" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="FechaIng" HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" />
|
||||
<asp:BoundField DataField="TipoEvento" HeaderText="Tipo" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="AsuntoDescripcion" HeaderText="Asunto Descripción" ItemStyle-HorizontalAlign="Left" />
|
||||
<asp:BoundField DataField="Usuario" HeaderText="Usuario" ItemStyle-HorizontalAlign="Left" />
|
||||
|
||||
|
||||
|
||||
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
108
CRM/RepAgendasBitacoras.aspx.cs
Normal file
108
CRM/RepAgendasBitacoras.aspx.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Extensiones;
|
||||
using System.Data;
|
||||
using Microsoft.Reporting.WebForms;
|
||||
|
||||
using ADSNetLibrary.SIGAPI.Services.CRM;
|
||||
using ADSNetLibrary.SIGAPI.Models.CRM.Request;
|
||||
|
||||
//using ADSNetLibrary.SIGAPI.Helpers;
|
||||
|
||||
public partial class CRM_AgendasBitacoras : ClsPaginas
|
||||
{
|
||||
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InicializaDatos();
|
||||
CargaDatos();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#region "CARGA DATOS"
|
||||
protected void BtnConsultar_Click(object sender, EventArgs e)
|
||||
{
|
||||
CargaDatos();
|
||||
}
|
||||
|
||||
protected void CargaDatos()
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
//nt CveEmpresa, int CveVendedor, int CveTipoProceso, DateTime FechaInicio, DateTime FechaFin
|
||||
|
||||
if (ObjCRM.RepAgendasBitacoras(UsuarioActual.CveEmpresa, DdlVendedor.SelectedValue.ToEntero(),DdlTipoProceso.SelectedValue.ToEntero(), TxtFechaInicio.Text.ToDate(), TxtFechaFin.Text.ToDate()))
|
||||
{
|
||||
GVDatos.DataSource = ObjCRM.DtResultados;
|
||||
GVDatos.DataBind();
|
||||
}
|
||||
|
||||
ObjCRM.Dispose();
|
||||
UPDatos.Update();
|
||||
|
||||
}
|
||||
|
||||
protected void GVDatos_RowDataBound(object sender, GridViewRowEventArgs e)
|
||||
{
|
||||
if (e.Row.RowType == DataControlRowType.DataRow)
|
||||
{
|
||||
//if (e.Row.DataKey("CveAcercamiento").ToEntero() > 0)
|
||||
// e.Row.FCHyperLink("HplNombreAcercamiento").NavigateUrl = String.Format("/CRM/Acercamiento.aspx?CveAcercamiento={0}", e.Row.DataKey("CveAcercamiento"));
|
||||
}
|
||||
}
|
||||
|
||||
protected void InicializaDatos()
|
||||
{
|
||||
|
||||
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
DdlVendedor.Items.Insert(0, new ListItem("Todos ", "-1"));
|
||||
DdlVendedor.DataBind();
|
||||
|
||||
DdlVendedor.SelectedValueExist(UsuarioActual.CveVendedor);
|
||||
|
||||
//CALCULAMOS EL INTERVALO DE LA SEMANA ACTUAL
|
||||
TxtFechaInicio.Text = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek) + 1).ToShortDateString();
|
||||
TxtFechaFin.Text = DateTime.Now.AddDays((7 - (int)DateTime.Now.DayOfWeek)).ToShortDateString();
|
||||
//DdlPS.setEsWebService(true);
|
||||
//DdlPS.SelectedValue = "-1";
|
||||
//DdlPS.SelectedText = "Todos";
|
||||
//DataTable dtGiroClasificaciones = get_GlobalDTClienteClasificaciones(UsuarioActual.CveEmpresa);
|
||||
//DdlGiroClasificacion.DataSource = dtGiroClasificaciones;
|
||||
//DdlGiroClasificacion.DataBind();
|
||||
//DdlGiroClasificacion.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, 1, -1);
|
||||
RequestMedioCaptacion MedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa);
|
||||
RequestTipoProceso tipoProceso = new RequestTipoProceso(UsuarioActual.CveEmpresa, 1, -1);
|
||||
|
||||
//DdlEtapaProceso .DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable(cRMService.GetEtapaProcesoCRM(EtapaProceso).Result);
|
||||
//DdlMedioCaptacion.DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable( cRMService.GetMedioCaptacionCRM(MedioCaptacion).Result);
|
||||
DdlTipoProceso.DataSource = ADSNetLibrary.SIGAPI.Helpers.ExtensionMethods.ToDataTable(cRMService.GetTipoProcesoCRM(tipoProceso).Result);
|
||||
|
||||
//DdlEtapaProceso.DataBind();
|
||||
//DdlMedioCaptacion.DataBind();
|
||||
DdlTipoProceso.DataBind();
|
||||
|
||||
//DdlEtapaProceso.Items.Insert(0,new ListItem("Todas", "-1"));
|
||||
//DdlMedioCaptacion.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
DdlTipoProceso.Items.Insert(0, new ListItem("Todos", "-1"));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
protected void LnkExcel_Click(object sender, EventArgs e)
|
||||
{
|
||||
GVDatos.ExportToExcelx("RepAgendaBiracora.xls");
|
||||
}
|
||||
}
|
||||
43
Inicio.aspx
43
Inicio.aspx
@@ -1322,7 +1322,7 @@
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<asp:Label ID="LblEmpresaCRM" runat="server" Text="" Style="font-size: 16px; display: none; text-align: center;"></asp:Label>
|
||||
<a id="LnkTituloLink" class="Texto" runat="server" target="_blank" style="font-size: 16px; display: none; text-align: center;"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1792,8 +1792,8 @@
|
||||
$("#DdlAcercamientoCRM").val('-1').change();
|
||||
$("#DdlContactoCRM").val('-1').change();
|
||||
|
||||
$("#<%=LblEmpresaCRM.ClientID%>").css("display", "none")
|
||||
$("#<%=LblEmpresaCRM.ClientID%>").text("");
|
||||
$("#<%=LnkTituloLink.ClientID%>").css("display", "none")
|
||||
$("#<%=LnkTituloLink.ClientID%>").text("");
|
||||
}
|
||||
|
||||
function updateEvent(event, element) {
|
||||
@@ -1874,12 +1874,41 @@
|
||||
//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 != "" && event.EmpresaCRM != undefined) {
|
||||
$("#<%=LblEmpresaCRM.ClientID%>").css("display", "")
|
||||
$("#<%=LblEmpresaCRM.ClientID%>").text("Empresa: "+ event.EmpresaCRM);
|
||||
if (event.CveEmpresaCRM > 0 || event.CveAcercamientoCRM > 0 || event.CvePersonal > 0 || event.CveCliente > 0 || event.CveProveedor > 0 ) {
|
||||
|
||||
$("#<%=LnkTituloLink.ClientID%>").css("display", "");
|
||||
|
||||
|
||||
|
||||
if (event.CveAcercamientoCRM > 0) {
|
||||
$("#<%=LnkTituloLink.ClientID%>").text("Acercamiento/Oportunidad: " + event.NombreAcercamiento);
|
||||
$("#<%=LnkTituloLink.ClientID%>").attr("href", "/CRM/Acercamiento.aspx?CveAcercamiento=" + event.CveAcercamientoCRM);
|
||||
} else if (event.CveEmpresaCRM > 0) {
|
||||
$("#<%=LnkTituloLink.ClientID%>").text("Prospecto: " + event.EmpresaCRM);
|
||||
$("#<%=LnkTituloLink.ClientID%>").attr("href", "/CRM/EmpresaCRM.aspx?CveEmpresaCRM=" + event.CveEmpresaCRM);
|
||||
}
|
||||
|
||||
if (event.CvePersonal > 0) {
|
||||
|
||||
$("#<%=LnkTituloLink.ClientID%>").text("Personal: " + event.NomprePersonal);
|
||||
$("#<%=LnkTituloLink.ClientID%>").attr("href", "/RH/Personal.aspx?CvePersonal=" + event.CvePersonal);
|
||||
}
|
||||
|
||||
if (event.CveCliente > 0) {
|
||||
$("#<%=LnkTituloLink.ClientID%>").text("Cliente: " + event.NombreCliente);
|
||||
$("#<%=LnkTituloLink.ClientID%>").attr("href", "/Ventas/Clientes.aspx?CveCliente=" + event.CveCliente);
|
||||
}
|
||||
|
||||
if (event.CveProveedor > 0) {
|
||||
$("#<%=LnkTituloLink.ClientID%>").text("Proveedor: " + event.NombreProveedor);
|
||||
$("#<%=LnkTituloLink.ClientID%>").attr("href", "/Compras/Proveedores.aspx?CveProveedor=" + event.CveProveedor);
|
||||
}
|
||||
|
||||
} else {
|
||||
$("#<%=LblEmpresaCRM.ClientID%>").css("display", "none")
|
||||
|
||||
$("#<%=LnkTituloLink.ClientID%>").css("display", "none")
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -911,7 +911,7 @@ Partial Class Inicio
|
||||
Asunto = $"Acercamiento oportunidad CRM: {DdlAcercamientoCRM.SelectedItem.Text} {TxtAsuntoAgenda.Text}"
|
||||
End If
|
||||
|
||||
If CveEmpresaCRM > 0 And CveAcercamientoCRM = 0 And CveContactoCRM = 0 Then
|
||||
If CveEmpresaCRM > 0 And CveAcercamientoCRM <= 0 And CveContactoCRM <= 0 Then
|
||||
Asunto = $"Prospecto CRM: {DdlEmpresaCRM.SelectedItem.Text} {TxtAsuntoAgenda.Text}"
|
||||
End If
|
||||
Exit Select
|
||||
@@ -981,7 +981,7 @@ Partial Class Inicio
|
||||
CheckDiasSemana.ClearSelection()
|
||||
RBLRecurrencia_SelectedIndexChanged(RBLRecurrencia, EventArgs.Empty)
|
||||
TxtFrecuencia.Text = "1"
|
||||
LblEmpresaCRM.Text = ""
|
||||
'LnkTituloLink.Text = ""
|
||||
|
||||
UpModalAgenda.Update()
|
||||
End Sub
|
||||
|
||||
@@ -512,6 +512,9 @@
|
||||
<td width="95px"><b>Empresa:</b> </td>
|
||||
<td width="200px">
|
||||
<asp:Label ID="LblEmpresaCRM" runat="server" Text="Cliente"></asp:Label></td>
|
||||
<td width="135px" runat="server" id="Td5"><b>Enviar Mail:</b></td>
|
||||
<td width="85px">
|
||||
<asp:CheckBox ID="ChkEnviarFacturaCRM" runat="server" /></td>
|
||||
</tr>
|
||||
<tr align="left" runat="server" id="trCRM2" visible="false">
|
||||
<td><b>RFC:</b> </td>
|
||||
|
||||
@@ -2,14 +2,18 @@
|
||||
Option Strict On
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Diagnostics
|
||||
Imports System.Globalization
|
||||
Imports System.IO
|
||||
Imports System.Net.Http
|
||||
Imports System.Security.Cryptography.X509Certificates
|
||||
Imports System.Xml
|
||||
Imports ADSNetLibrary.SIGAPI.Models.CRM.Request
|
||||
Imports ADSNetLibrary.SIGAPI.Services.CRM
|
||||
Imports ADSTimbrado
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Owin.Security.Provider
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
@@ -1917,6 +1921,20 @@ Partial Class Ventas
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property CorreoContactoCRM As String
|
||||
Get
|
||||
If ViewState("CorreoContactoCRM") Is Nothing Then
|
||||
ViewState("CorreoContactoCRM") = ""
|
||||
End If
|
||||
Return ViewState("CorreoContactoCRM").ToString()
|
||||
End Get
|
||||
Set(value As String)
|
||||
ViewState("CorreoContactoCRM") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
Private Property DtPedidos2 As DataTable
|
||||
Get
|
||||
Return CType(ViewState("DtPedidos2"), DataTable)
|
||||
@@ -2661,6 +2679,15 @@ Partial Class Ventas
|
||||
|
||||
If Request("CveAcercamientoCRM") IsNot Nothing AndAlso IsNumeric(Request("CveAcercamientoCRM")) AndAlso Request("CveAcercamientoCRM").ToEntero() > 0 Then
|
||||
ViewState("CveAcercamientoCRM") = Request("CveAcercamientoCRM")
|
||||
|
||||
Dim cRMService As ICRMService = New CRMService(System.Configuration.ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
|
||||
Dim AcercamientoModel As RequestAcercamiento = New RequestAcercamiento(UsuarioActual.CveEmpresa, CveAcercamientoCRM)
|
||||
Dim objAcercamiento = cRMService.GetAceracamientoCRM(AcercamientoModel)
|
||||
|
||||
If objAcercamiento.Result.Count > 0 Then
|
||||
CorreoContactoCRM = objAcercamiento.Result(0).CorreoContacto
|
||||
End If
|
||||
|
||||
Else
|
||||
ViewState("CveAcercamientoCRM") = -1
|
||||
End If
|
||||
@@ -9804,7 +9831,21 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'Paso CRM actualizar importe de acercamiento y guardar en bitacora
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
|
||||
|
||||
If Not (CRMActualizaImporteBitacora(CveAcercamientoCRM, ObjFactura.SubTotal, ObjFactura.SerieFolio, ObjVentas.IniciaTransacSQL)) Then
|
||||
ErrorList.Add("Error al actualizar datos Acercamiento/Oportunidad CRM.")
|
||||
End If
|
||||
End If
|
||||
|
||||
If ObjFactura.CveVenta > 0 AndAlso ErrorList.Count = 0 AndAlso (SeGuardoPrePoliza Or ObjFactura.TipoDocto.Contiene("Ped", "Cot", "DPe", "PeC", "PA", "Pd2")) Then
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ObjVentas.Commit()
|
||||
|
||||
'ENVIAR POLIZA VIRTUAL
|
||||
@@ -10085,6 +10126,7 @@ Partial Class Ventas
|
||||
End If
|
||||
End If
|
||||
|
||||
'CRM
|
||||
If DdlTipoComprobante.SelectedValue.Contiene("Cot") AndAlso CveEmpresaCRM > 0 AndAlso CveAcercamientoCRM > 0 Then
|
||||
|
||||
Dim ArchivoCotRdlc As New System.IO.FileInfo(String.Format("{0}Formatos/Cotizacion.rdlc", UsuarioActual.Empresa.Ruta))
|
||||
@@ -10092,6 +10134,25 @@ Partial Class Ventas
|
||||
|
||||
If ArchivoCotRdlc.Exists Or ArchivoCotMrt.Exists Then
|
||||
MensajeAlert.AppendFormat("<ul><li><a class=""Texto"" href=""/Compras/PopUpVerFactura.aspx?P={0}"">Descargar PDF</a></li></ul><br/>", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta)))
|
||||
|
||||
|
||||
If ChkEnviarFacturaCRM.Checked AndAlso CorreoContactoCRM.Trim.Length > 0 Then
|
||||
|
||||
Try
|
||||
'MANDA CORREO
|
||||
Dim strURLHOST = String.Format("{0}://{1}:{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port)
|
||||
Dim Factura = New Modelos.Factura(UsuarioActual, CveVenta, UsuarioActual.CveEmpresa, EsCancelacion:=False, CargaDTDetalle:=False, CargaDatosCliente:=False, CargaDatosRelacionados:=False)
|
||||
Dim Hilo As New System.Threading.Thread(Sub() GeneraPDFFactura(True, Factura, UsuarioActual, strURLHOST, CorreoCRM:=CorreoContactoCRM))
|
||||
Hilo.Start()
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al enviar el PDF", ex)
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
Else
|
||||
MensajeAlert.Append("Ocurrió un error al generar el PDF. Por favor vuelva a entrar a la factura para imprimir el PDF. ")
|
||||
End If
|
||||
@@ -10139,7 +10200,6 @@ Partial Class Ventas
|
||||
If DdlTipoComprobante.SelectedValue = "Cot" Then
|
||||
|
||||
If Not CveEmpresaCRM > 0 Then
|
||||
|
||||
'EN EMPRESA DE ACUMULADORES NO DESCARGAR EL PDF
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) <> "1" Then
|
||||
If CveVenta > 0 Then MensajeAlert = New StringBuilder
|
||||
@@ -10157,6 +10217,8 @@ Partial Class Ventas
|
||||
End If
|
||||
|
||||
GeneraPDFCotizacion(ChkEnviarFactura.Checked) ' MANDA CORREO
|
||||
Else
|
||||
'Enviar pore correo cot CRM
|
||||
End If
|
||||
ElseIf DdlTipoComprobante.SelectedValue = "Rem" Then
|
||||
If UsuarioActual.CveEmpresa.Contiene(81, 109) Then
|
||||
@@ -10307,6 +10369,33 @@ Partial Class Ventas
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function CRMActualizaImporteBitacora(CveAcercamientoCRMActualizar As Integer, ImporteCRM As Decimal, SerieFolioVenta As String, ByRef ObjTRansaccion As SqlTransaction) As Boolean
|
||||
|
||||
Dim cRMService As ICRMService = New CRMService(System.Configuration.ConfigurationManager.ConnectionStrings("Conexion").ConnectionString)
|
||||
Dim AcercamientoModel As RequestAcercamiento = New RequestAcercamiento(UsuarioActual.CveEmpresa, CveAcercamientoCRMActualizar)
|
||||
Dim objAcercamiento = cRMService.GetAceracamientoCRM(AcercamientoModel)
|
||||
Dim ImporteAcercamiento As Decimal = objAcercamiento.Result(0).Importe.ToDecimal
|
||||
Dim CveEtapaProcesoCRM As Integer = objAcercamiento.Result(0).CveEtapaProcesoActual.ToEntero
|
||||
Dim CveTipoProcesoCRM As Integer = objAcercamiento.Result(0).CveTipoProceso.ToEntero
|
||||
|
||||
Dim Respuesta As Boolean = False
|
||||
Dim ObjCRM As New ClsCRM(ObjTRansaccion)
|
||||
Dim ObjEventoBitacora As New ClsOIEventos(ObjTRansaccion)
|
||||
|
||||
If objAcercamiento.Result.Count > 0 Then
|
||||
If ObjCRM.UpdateAcercamientoCotizacion(CveAcercamientoCRMActualizar, ImporteCRM, UsuarioActual.CveEmpresa) Then
|
||||
If ObjEventoBitacora.AddEventoBitacora($"Se actualiza Importe de {ImporteAcercamiento.ToString("###,###,###.00") } a {ImporteCRM.ToString("###,###,###.00")} por cotización {SerieFolioVenta}", "",
|
||||
UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveAcercamientoCRM:=CveAcercamientoCRMActualizar, CveEtapaProcesoCRM:=CveEtapaProcesoCRM,
|
||||
CveTipoProcesoCRM:=CveTipoProcesoCRM) Then
|
||||
Respuesta = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Return Respuesta
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub CreaObjetosVentaAmortizacion(ObjVentas As ClsVentas, FolioFiscalRelacionado As String, CveAnticipoPadre As Integer,
|
||||
Optional CveVentasPadre As Integer = -1, Optional NCDescuento As Boolean = False)
|
||||
ObjFacturaDevolucion = New Modelos.Factura
|
||||
@@ -15694,7 +15783,7 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region "¡ P D F R E P O R T V I E W E R !"
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String)
|
||||
Private Sub GeneraPDFFactura(EnviaCorreo As Boolean, Factura As Modelos.Factura, UsuarioActual As Usuario, strURLHOST As String, Optional CorreoCRM As String = "")
|
||||
'GUARDA PDF
|
||||
Dim LocalSerieFolio As String = String.Empty
|
||||
Dim LocalTipoDocto As String = String.Empty
|
||||
@@ -15726,7 +15815,7 @@ Partial Class Ventas
|
||||
Dim FIXML As New FileInfo(ArchivoXML)
|
||||
Dim FIPDF As New FileInfo(ArchivoPDF)
|
||||
If FIXML.Exists AndAlso FIPDF.Exists Then
|
||||
MandaMails(UsuarioActual, CveVenta, Factura.TipoDocto, LocalSerieFolio, EnviaCorreo, ArchivoXML, ArchivoPDF, ArchivoAdjunto)
|
||||
MandaMails(UsuarioActual, CveVenta, Factura.TipoDocto, LocalSerieFolio, EnviaCorreo, ArchivoXML, ArchivoPDF, ArchivoAdjunto, CorreoCRM)
|
||||
Else
|
||||
ErrorCorreo = True
|
||||
End If
|
||||
@@ -20921,11 +21010,13 @@ Partial Class Ventas
|
||||
#End Region
|
||||
|
||||
#Region " MANDA CORREO "
|
||||
Private Sub MandaMails(UsuarioActual As Usuario, CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String, Adjunto As String)
|
||||
Private Sub MandaMails(UsuarioActual As Usuario, CveVenta As Integer, TipoDocto As String, SerieFolio As String, EnviarFactura As Boolean, XML As String, PDF As String, Adjunto As String, Optional CorreoCRM As String = "")
|
||||
|
||||
Dim ObjMail As New ClsSisMail()
|
||||
Dim ResultadoMail As Integer = 0
|
||||
|
||||
Dim CorreoDestino As String = If(CorreoCRM.Trim.Length > 0, CorreoCRM, Mail)
|
||||
|
||||
Try
|
||||
|
||||
Dim Asunto As String = String.Empty
|
||||
@@ -20977,7 +21068,7 @@ Partial Class Ventas
|
||||
Dim DisplayName As String = ""
|
||||
If UsuarioActual.CveEmpresa = 119 Then DisplayName = "Facturación Agroquímicos JAM"
|
||||
|
||||
If ObjMail.SendMail(EmpresaActual, Mail, Asunto, Cuerpo, MailCC, LSRutasMail, Displayname:=DisplayName) Then
|
||||
If ObjMail.SendMail(EmpresaActual, CorreoDestino, Asunto, Cuerpo, MailCC, LSRutasMail, Displayname:=DisplayName) Then
|
||||
ResultadoMail = 1
|
||||
Else
|
||||
ResultadoMail = 3
|
||||
@@ -20986,10 +21077,10 @@ Partial Class Ventas
|
||||
|
||||
'CASO ESPECIAL
|
||||
If CveUsuarioActual = 1446 Then ' Flora
|
||||
Dim str As String = "Flora Envio: Correo:" & Mail & " - CorreosCC: " & MailCC & " RM:" & ResultadoMail.ToString()
|
||||
Dim str As String = "Flora Envio: Correo:" & CorreoDestino & " - CorreosCC: " & MailCC & " RM:" & ResultadoMail.ToString()
|
||||
str.GuardaLog()
|
||||
ElseIf CveUsuarioActual = 1513 Then ' Flora
|
||||
Dim str As String = "Flora Envio (secundario): Correo:" & Mail & " - CorreosCC: " & MailCC & " RM:" & ResultadoMail.ToString()
|
||||
Dim str As String = "Flora Envio (secundario): Correo:" & CorreoDestino & " - CorreosCC: " & MailCC & " RM:" & ResultadoMail.ToString()
|
||||
str.GuardaLog()
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user