CRM Mejoras
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user