Cambio CRM a la API
This commit is contained in:
@@ -9,6 +9,13 @@ using System.Data;
|
||||
|
||||
using Extensiones;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using ADSNetLibrary.SIGAPI.Services.CRM;
|
||||
using ADSNetLibrary.SIGAPI.Models.CRM.Request;
|
||||
using ADSNetLibrary.SIGAPI.Models.CRM.Response;
|
||||
using ADSNetLibrary.SIGAPI.Models.Ventas.Request;
|
||||
using ADSNetLibrary.SIGAPI.Models.Ventas.Response;
|
||||
using MoreLinq;
|
||||
using ADSNetLibrary.SIGAPI.Services;
|
||||
|
||||
public partial class CRM_Acercamiento : ClsPaginas
|
||||
{
|
||||
@@ -246,6 +253,19 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
ViewState["CvePS"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean TieneCotizacion
|
||||
{
|
||||
get
|
||||
{
|
||||
return (Boolean)ViewState["TieneCotizacion"];
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
ViewState["TieneCotizacion"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
@@ -290,65 +310,61 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
{
|
||||
if (CveAcercamiento > 0)
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
|
||||
if (ObjCRM.GetAcercamiento(UsuarioActual.CveEmpresa, CveAcercamiento: CveAcercamiento) && ObjCRM.DtResultados.Rows.Count > 0)
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestAcercamiento AcercamientoModel = new RequestAcercamiento(UsuarioActual.CveEmpresa, CveAcercamiento);
|
||||
var objAcercamiento = cRMService.GetAceracamientoCRM(AcercamientoModel);
|
||||
if (objAcercamiento.Result.Count > 0)
|
||||
{
|
||||
LblEncabezadoAcercamiento.Text = String.Format("<span class='bold' style='color: #32c5d2;'>{0}:</span> {1}", ObjCRM.DtResultados.FiltroPrimeroValor("TipoProceso").ToUpper(), ObjCRM.DtResultados.FiltroPrimeroValor("NombreAcercamiento").ToUpper());
|
||||
CveTipoProceso = ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso").ToEntero();
|
||||
LblEncabezadoAcercamiento.Text = String.Format("<span class='bold' style='color: #32c5d2;'>{0}:</span> {1}", objAcercamiento.Result[0].TipoProceso.ToUpper(), objAcercamiento.Result[0].NombreAcercamiento.ToUpper());
|
||||
CveTipoProceso = objAcercamiento.Result[0].CveTipoProceso.ToEntero();
|
||||
//SECCION DATOS DEL ACERCAMIENTO
|
||||
TxtNombreAcercamiento.Text = ObjCRM.DtResultados.FiltroPrimeroValor("NombreAcercamiento");
|
||||
TxtDescripcion.Text = ObjCRM.DtResultados.FiltroPrimeroValor("Descripcion");
|
||||
TxtFechaApertura.Text = ObjCRM.DtResultados.FiltroPrimeroValor("FechaApertura").ToDateTime().ToShortDateString();
|
||||
TxtFechaCierre.Text = (ObjCRM.DtResultados.FiltroPrimeroValor("FechaCierre") == "") ? "" : ObjCRM.DtResultados.FiltroPrimeroValor("FechaCierre").ToDateTime().ToShortDateString();
|
||||
TxtImporte.Text = String.Format("{0:C2}", ObjCRM.DtResultados.FiltroPrimeroValor("Importe").ToString().ToDecimal());
|
||||
TxtComision.Text = String.Format("{0:C2}", ObjCRM.DtResultados.FiltroPrimeroValor("Comision").ToString().ToDecimal());
|
||||
|
||||
DdlProbabilidadAcercamiento.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveProbabilidadAcercamiento"));
|
||||
DdlPrioridad.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("Prioridad"));
|
||||
TxtNombreAcercamiento.Text = objAcercamiento.Result[0].NombreAcercamiento;
|
||||
TxtDescripcion.Text = objAcercamiento.Result[0].Descripcion;
|
||||
TxtFechaApertura.Text = objAcercamiento.Result[0].FechaApertura.ToDateTime().ToShortDateString();
|
||||
TxtFechaCierre.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") ? "" : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString();
|
||||
TxtImporte.Text = String.Format("{0:C2}", objAcercamiento.Result[0].Importe.ToEntero());
|
||||
TxtComision.Text = String.Format("{0:C2}", objAcercamiento.Result[0].Comision.ToEntero());
|
||||
DdlProbabilidadAcercamiento.SelectedValueExist(objAcercamiento.Result[0].CveProbabilidadAcercamiento);
|
||||
DdlPrioridad.SelectedValueExist(objAcercamiento.Result[0].Prioridad);
|
||||
|
||||
CargaDdl();
|
||||
//SECCION DATOS DE LA EMPRESA
|
||||
DdlEmpresaCRM.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveEmpresaCRM"));
|
||||
//DdlContactoPrincipal.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveContactoPrincipal"));
|
||||
DdlEmpresaCRM.SelectedValueExist(objAcercamiento.Result[0].CveEmpresaCRM);
|
||||
|
||||
//SECCION DATOS DEL PROCESO
|
||||
//DdlTipoProceso.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso"));
|
||||
DdlEtapaProceso.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveEtapaProcesoActual"));
|
||||
DdlVendedor.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveVendedor"));
|
||||
DdlMedioCaptacion.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveMedioCaptacion"));
|
||||
DdlEtapaProceso.SelectedValueExist(objAcercamiento.Result[0].CveEtapaProcesoActual);
|
||||
DdlVendedor.SelectedValueExist(objAcercamiento.Result[0].CveVendedor);
|
||||
DdlMedioCaptacion.SelectedValueExist(objAcercamiento.Result[0].CveMedioCaptacion);
|
||||
|
||||
//CARGA MODAL CIERRE-CANCELACION
|
||||
TxtFechaCierreRechazo.Text = (ObjCRM.DtResultados.FiltroPrimeroValor("FechaCierre") == "") ? DateTime.Now.ToShortDateString() : ObjCRM.DtResultados.FiltroPrimeroValor("FechaCierre").ToDateTime().ToShortDateString();
|
||||
DdlRechazoMotivo.SelectedValueExist(ObjCRM.DtResultados.FiltroPrimeroValor("CveRechazoMotivo"));
|
||||
TxtObservacionRechazo.Text = ObjCRM.DtResultados.FiltroPrimeroValor("ObservacionRechazo");
|
||||
TxtFechaCierreRechazo.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") ? DateTime.Now.ToShortDateString() : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString();
|
||||
DdlRechazoMotivo.SelectedValueExist(objAcercamiento.Result[0].CveRechazoMotivo);
|
||||
TxtObservacionRechazo.Text = objAcercamiento.Result[0].ObservacionRechazo;
|
||||
|
||||
//CARGAMOS PARAMETROS
|
||||
NombreAcercamiento = ObjCRM.DtResultados.FiltroPrimeroValor("NombreAcercamiento").ToUpper();
|
||||
CveEmpresaCRM = ObjCRM.DtResultados.FiltroPrimeroValor("CveEmpresaCRM").ToEntero();
|
||||
CveVendedorAsignado = ObjCRM.DtResultados.FiltroPrimeroValor("CveVendedor").ToEntero();
|
||||
CveContactoPrincipal = (ObjCRM.DtResultados.FiltroPrimeroValor("CveTipoProceso").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveContactoPrincipal").ToEntero() : -1;
|
||||
NombreAcercamiento = objAcercamiento.Result[0].NombreAcercamiento.ToUpper();
|
||||
CveEmpresaCRM = objAcercamiento.Result[0].CveEmpresaCRM.ToEntero();
|
||||
CveVendedorAsignado = objAcercamiento.Result[0].CveVendedor.ToEntero();
|
||||
CveContactoPrincipal = (objAcercamiento.Result[0].CveTipoProceso.ToEntero() > 0) ? objAcercamiento.Result[0].CveContactoPrincipal.ToEntero() : -1;
|
||||
|
||||
CveEtapaActual = ObjCRM.DtResultados.FiltroPrimeroValor("CveEtapaProcesoActual").ToEntero();
|
||||
|
||||
CveEtapaActual = objAcercamiento.Result[0].CveEtapaProcesoActual.ToEntero();
|
||||
|
||||
CveEncuestaProcesoCRM = (ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaProcesoCRM").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaProcesoCRM").ToEntero() : -1;
|
||||
CveEncuestaAplicadaProceso = (ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() > 0) ? ObjCRM.DtResultados.FiltroPrimeroValor("CveEncuestaAplicadaProceso").ToEntero() : -1;
|
||||
//CveEtapaBitacoraSeleccionada = CveEtapaActual;
|
||||
|
||||
CvePS = ObjCRM.DtResultados.FiltroPrimeroValor("CvePS").ToEntero();
|
||||
CveEncuestaProcesoCRM = (objAcercamiento.Result[0].CveEncuestaProcesoCRM.ToEntero() > 0) ? objAcercamiento.Result[0].CveEncuestaProcesoCRM.ToEntero() : -1;
|
||||
CveEncuestaAplicadaProceso = (objAcercamiento.Result[0].CveEncuestaAplicadaProceso.ToEntero() > 0) ? objAcercamiento.Result[0].CveEncuestaAplicadaProceso.ToEntero() : -1;
|
||||
|
||||
CvePS = objAcercamiento.Result[0].CvePS.ToEntero();
|
||||
|
||||
HdfEtapaSeleccionada.Value = CveEtapaActual.ToString();
|
||||
//INHABILITAMOS CAMPOS QUE NO SE PUEDEN EDITAR
|
||||
DdlEmpresaCRM.Enabled = false;
|
||||
//DdlTipoProceso.Enabled = false;
|
||||
|
||||
//MOSTRAMOS BOTONES
|
||||
BtnGuardarAcercamiento.Text = "Actualizar";
|
||||
BtnGuardarAcercamiento.Visible = true;
|
||||
BtnEliminarAcercamiento.Visible = true;
|
||||
//DivVerBitacoraCompleta.Visible = true;
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Alert("La Empresa solicitada no existe, por favor revise su búsqueda.", ModExtensiones.TipoMensaje.MsgAdvertencia);
|
||||
@@ -361,7 +377,6 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
CveEncuestaProcesoCRM = -1;
|
||||
CveEncuestaAplicadaProceso = -1;
|
||||
}
|
||||
ObjCRM.Dispose();
|
||||
|
||||
if (CveAcercamiento > 0)
|
||||
{
|
||||
@@ -429,47 +444,53 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
|
||||
protected void CargaDdl()
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestProbalidadAcercamiento ProbalidadAcercamiento = new RequestProbalidadAcercamiento(UsuarioActual.CveEmpresa, 1);
|
||||
var ObjProbalidadAcercamiento = cRMService.GetProbabilidadAceracamientoCRM(ProbalidadAcercamiento);
|
||||
RequestEmpresasCRM EmpresaCRM = new RequestEmpresasCRM(UsuarioActual.CveEmpresa, -1);
|
||||
var objEmpresaCRM = cRMService.GetEmpresasCRM(EmpresaCRM);
|
||||
RequestMedioCaptacion MedioCaptacion = new RequestMedioCaptacion(UsuarioActual.CveEmpresa);
|
||||
var ObjMedioCaptacion = cRMService.GetMedioCaptacionCRM(MedioCaptacion);
|
||||
|
||||
if (ObjCRM.GetProbabilidadAcercamiento(UsuarioActual.CveEmpresa, 1))
|
||||
if (ObjProbalidadAcercamiento.Result.Count > 0)
|
||||
{
|
||||
DdlProbabilidadAcercamiento.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}", CveTipoProceso));
|
||||
DataTable DtProbabilidadAcercamiento = ObjProbalidadAcercamiento.Result.ToDataTable();
|
||||
DdlProbabilidadAcercamiento.DataSource = DtProbabilidadAcercamiento.FiltraParametros(String.Format("CveTipoProceso = {0}", CveTipoProceso));
|
||||
}
|
||||
if (ObjCRM.GetEmpresasCRM(UsuarioActual.CveEmpresa))
|
||||
|
||||
|
||||
if (objEmpresaCRM.Result.Count > 0)
|
||||
{
|
||||
DdlEmpresaCRM.DataSource = ObjCRM.DtResultados;
|
||||
DdlEmpresaCRM.DataSource = objEmpresaCRM.Result;
|
||||
DdlEmpresaCRM.Items.Insert(0, new ListItem("Seleccione ", "-1"));
|
||||
}
|
||||
//if (ObjCRM.GetTipoProceso(UsuarioActual.CveEmpresa, 1))
|
||||
//{
|
||||
// DdlTipoProceso.DataSource = ObjCRM.DtResultados;
|
||||
// DdlTipoProceso.Items.Insert(0, new ListItem("Seleccione ", "-1"));
|
||||
//}
|
||||
if (ObjCRM.GetMedioCaptacion(UsuarioActual.CveEmpresa, 1))
|
||||
|
||||
|
||||
if (ObjMedioCaptacion.Result.Count > 0)
|
||||
{
|
||||
DdlMedioCaptacion.DataSource = ObjCRM.DtResultados.FiltraParametros(String.Format("CveTipoProceso = {0}",CveTipoProceso));
|
||||
DataTable DTMedioCaptacion = ObjMedioCaptacion.Result.ToDataTable();
|
||||
DdlMedioCaptacion.DataSource = DTMedioCaptacion.FiltraParametros(String.Format("CveTipoProceso = {0}", CveTipoProceso));
|
||||
DdlMedioCaptacion.Items.Insert(0, new ListItem("Seleccione ", "-1"));
|
||||
}
|
||||
|
||||
|
||||
DdlVendedor.DataSource = get_GlobalDTVendedores(UsuarioActual.CveEmpresa);
|
||||
ObjCRM.Dispose();
|
||||
|
||||
DdlProbabilidadAcercamiento.DataBind();
|
||||
DdlEmpresaCRM.DataBind();
|
||||
//DdlTipoProceso.DataBind();
|
||||
DdlVendedor.DataBind();
|
||||
DdlMedioCaptacion.DataBind();
|
||||
}
|
||||
|
||||
protected void CargaRechazosMotivos()
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
if (ObjCRM.GetRechazoMotivo(UsuarioActual.CveEmpresa, 1, CveTipoProceso))
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestRechazoMotivo RequestRechazoMotivo = new RequestRechazoMotivo(UsuarioActual.CveEmpresa, 1, CveTipoProceso);
|
||||
var objRequestRechazoMotivo = cRMService.GetRechazoMotivoCRM(RequestRechazoMotivo);
|
||||
if (objRequestRechazoMotivo.Result.Count > 0)
|
||||
{
|
||||
DdlRechazoMotivo.DataSource = ObjCRM.DtResultados;
|
||||
DdlRechazoMotivo.DataSource = objRequestRechazoMotivo.Result;
|
||||
DdlRechazoMotivo.Items.Insert(0, new ListItem("Seleccione ", "-1"));
|
||||
}
|
||||
ObjCRM.Dispose();
|
||||
DdlRechazoMotivo.DataBind();
|
||||
}
|
||||
|
||||
@@ -500,17 +521,19 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
protected void CargaContactos(int CveEmpresaCRM)
|
||||
{
|
||||
DdlContactoPrincipal.Items.Clear();
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestContactoEmpresaCRM contactoEmpresaCRM = new RequestContactoEmpresaCRM(CveEmpresaCRM, UsuarioActual.CveEmpresa);
|
||||
var objcontactoEmpresa = cRMService.GetContactosEmpresasCRM(contactoEmpresaCRM);
|
||||
|
||||
if (ObjCRM.GetContactoEmpresa(CveEmpresaCRM))
|
||||
if (objcontactoEmpresa.Result.Count > 0)
|
||||
{
|
||||
DdlContactoPrincipal.DataSource = ObjCRM.DtResultados;
|
||||
DdlContactoAgenda.DataSource = ObjCRM.DtResultados;
|
||||
DdlContactoPrincipal.DataSource = objcontactoEmpresa.Result;
|
||||
DdlContactoAgenda.DataSource = objcontactoEmpresa.Result;
|
||||
}
|
||||
DdlContactoPrincipal.Items.Insert(0, new ListItem("Seleccione ", "-1"));
|
||||
DdlContactoAgenda.Items.Insert(0, new ListItem("Seleccione ", "-1"));
|
||||
|
||||
ObjCRM.Dispose();
|
||||
//ObjCRM.Dispose();
|
||||
|
||||
DdlContactoPrincipal.DataBind();
|
||||
DdlContactoAgenda.DataBind();
|
||||
@@ -532,11 +555,13 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
{
|
||||
//DDLs
|
||||
DdlEtapaProceso.Items.Clear();
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, 1, CveTipoProceso);
|
||||
var ObjEtapaProceso = cRMService.GetEtapaProcesoCRM(EtapaProceso);
|
||||
|
||||
if (ObjCRM.GetEtapaProceso(UsuarioActual.CveEmpresa, CveTipoProceso, CveEstatus: 1))
|
||||
if (ObjEtapaProceso.Result.Count > 0)
|
||||
{
|
||||
DTEtapasProceso = ObjCRM.DtResultados;
|
||||
DTEtapasProceso = ObjEtapaProceso.Result.ToDataTable();
|
||||
OrdenEtapaActual = DTEtapasProceso.FiltroPrimeroValor("Orden", String.Format("CveEtapaProceso = {0}", CveEtapaActual)).ToEntero();
|
||||
|
||||
//SI LA ETAPA ES CANCELACION HABILITA MOSTRAR LAS DOS ETAPAS ANTERIORES
|
||||
@@ -549,7 +574,6 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
DdlEtapaProceso.DataSource = DTEtapasProceso.FiltraParametros(String.Format("(( Orden >= {0} ) AND ( Orden <= {1} )) OR (CveTipoEtapa = 4)", (OrdenEtapaActual - 1), (OrdenEtapaActual + 1)));
|
||||
}
|
||||
}
|
||||
ObjCRM.Dispose();
|
||||
DdlEtapaProceso.DataBind();
|
||||
}
|
||||
protected void DdlEtapaProceso_SelectedIndexChanged(object sender, EventArgs e)
|
||||
@@ -590,16 +614,16 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
if (CveAcercamiento > 0)
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
AcercaminetoModel AcercaminetoModel = new AcercaminetoModel();
|
||||
|
||||
ClsEncuestas ObjDatosTecnicos = new ClsEncuestas(ObjCRM.IniciaTransacSQL());
|
||||
//ClsOIEventos ObjBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL());
|
||||
|
||||
Boolean HuboError = true;
|
||||
|
||||
String NombreAcercamiento = TxtNombreAcercamiento.Text;
|
||||
String Descripcion = TxtDescripcion.Text == "" ? "-1" : TxtDescripcion.Text;
|
||||
|
||||
int CveEtapaProcesoActualActualizar = DdlEtapaProceso.SelectedValue.ToEntero();
|
||||
|
||||
int CveContactoPrincipal = DdlContactoPrincipal.SelectedValue.ToEntero();
|
||||
int CveVendedor = DdlVendedor.SelectedValue.ToEntero();
|
||||
int CveMedioCaptacion = DdlMedioCaptacion.SelectedValue.ToEntero();
|
||||
@@ -629,9 +653,25 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
{
|
||||
CveEncuestaAplicadaProceso = GuardaDatosTecnicos(ObjDatosTecnicos, CveEncuestaAplicadaProceso);
|
||||
}
|
||||
|
||||
if ((CveEncuestaAplicadaProceso != 0) && ObjCRM.UpdateAcercamiento(CveAcercamiento, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActualActualizar, CveVendedor, CveMedioCaptacion, CveProbabilidadAcercamiento,
|
||||
NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre, CvePS:DdlPS.SelectedValue.ToEntero()))
|
||||
AcercaminetoModel.CveAcercamiento = CveAcercamiento;
|
||||
AcercaminetoModel.CveContactoPrincipal = CveContactoPrincipal;
|
||||
AcercaminetoModel.CveTipoProceso = CveTipoProceso;
|
||||
AcercaminetoModel.CveEtapaProcesoActual = CveEtapaProcesoActualActualizar;
|
||||
AcercaminetoModel.CveVendedor = CveVendedor;
|
||||
AcercaminetoModel.CveMedioCaptacion = CveMedioCaptacion;
|
||||
AcercaminetoModel.CveProbabilidadAcercamiento = CveProbabilidadAcercamiento;
|
||||
AcercaminetoModel.NombreAcercamiento = NombreAcercamiento;
|
||||
AcercaminetoModel.Descripcion = Descripcion;
|
||||
AcercaminetoModel.Importe = Importe;
|
||||
AcercaminetoModel.Comision = Comision;
|
||||
AcercaminetoModel.Prioridad = Prioridad;
|
||||
AcercaminetoModel.CveUsuarioIng = UsuarioActual.CveUsuario;
|
||||
AcercaminetoModel.CveEncuestaAplicadaProceso = CveEncuestaAplicadaProceso;
|
||||
AcercaminetoModel.FechaApertura = FechaApertura;
|
||||
AcercaminetoModel.FechaCierre = (DateTime)FechaCierre;
|
||||
AcercaminetoModel.CvePS = DdlPS.SelectedValue.ToEntero();
|
||||
|
||||
if (cRMService.AcercamientoUpdate(AcercaminetoModel))
|
||||
{
|
||||
//String MensajeBitacora = (CveEtapaProcesoActualActualizar != CveEtapaActual) ? String.Format("Se actualizó la etapa del acercamiento a {0}.", DTEtapasProceso.FiltroPrimeroValor("EtapaProceso", "CveEtapaProceso = " + CveEtapaProcesoActualActualizar)) : String.Format("Se actualizó el Acercamiento {0} con Vendedor {2} y Contacto Principal {3}.", NombreAcercamiento, DdlTipoProceso.SelectedItem, DdlVendedor.SelectedItem, DdlContactoPrincipal.SelectedValue == "-1" ? "aun no asignado" : DdlContactoPrincipal.SelectedItem.Text);
|
||||
|
||||
@@ -644,9 +684,6 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
//}
|
||||
}
|
||||
|
||||
if (!HuboError) { ObjCRM.Commit(); } else { ObjCRM.RollBack(); }
|
||||
|
||||
ObjCRM.Dispose();
|
||||
ObjDatosTecnicos.Dispose();
|
||||
|
||||
//CARGA BITACORA
|
||||
@@ -669,8 +706,8 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
|
||||
protected void GuardarCambioEtapa()
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
AcercaminetoModel AcercaminetoModel = new AcercaminetoModel();
|
||||
String NombreAcercamiento = TxtNombreAcercamiento.Text;
|
||||
String Descripcion = TxtDescripcion.Text == "" ? "-1" : TxtDescripcion.Text;
|
||||
|
||||
@@ -696,15 +733,30 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
|
||||
int CveUsuarioIng = UsuarioActual.CveUsuario;
|
||||
|
||||
if (ObjCRM.UpdateAcercamiento(CveAcercamiento, CveContactoPrincipal, CveTipoProceso, CveEtapaProcesoActualActualizar, CveVendedor, CveMedioCaptacion, CveProbabilidadAcercamiento,
|
||||
NombreAcercamiento, Descripcion, Importe, Comision, Prioridad, UsuarioActual.CveUsuario, CveEncuestaAplicadaProceso: CveEncuestaAplicadaProceso, FechaApertura: FechaApertura, FechaCierre: FechaCierre, CvePS: DdlPS.SelectedValue.ToEntero()))
|
||||
AcercaminetoModel.CveAcercamiento = CveAcercamiento;
|
||||
AcercaminetoModel.CveContactoPrincipal = CveContactoPrincipal;
|
||||
AcercaminetoModel.CveTipoProceso = CveTipoProceso;
|
||||
AcercaminetoModel.CveEtapaProcesoActual = CveEtapaProcesoActualActualizar;
|
||||
AcercaminetoModel.CveVendedor = CveVendedor;
|
||||
AcercaminetoModel.CveMedioCaptacion = CveMedioCaptacion;
|
||||
AcercaminetoModel.CveProbabilidadAcercamiento = CveProbabilidadAcercamiento;
|
||||
AcercaminetoModel.NombreAcercamiento = NombreAcercamiento;
|
||||
AcercaminetoModel.Descripcion = Descripcion;
|
||||
AcercaminetoModel.Importe = Importe;
|
||||
AcercaminetoModel.Comision = Comision;
|
||||
AcercaminetoModel.Prioridad = Prioridad;
|
||||
AcercaminetoModel.CveUsuarioIng = UsuarioActual.CveUsuario;
|
||||
AcercaminetoModel.CveEncuestaAplicadaProceso = CveEncuestaAplicadaProceso;
|
||||
AcercaminetoModel.FechaApertura = FechaApertura;
|
||||
AcercaminetoModel.FechaCierre = (DateTime)FechaCierre;
|
||||
AcercaminetoModel.CvePS = DdlPS.SelectedValue.ToEntero();
|
||||
|
||||
if (cRMService.AcercamientoUpdate(AcercaminetoModel))
|
||||
{
|
||||
CveEtapaActual = CveEtapaProcesoActualActualizar;
|
||||
HdfEtapaSeleccionada.Value = CveEtapaProcesoActualActualizar.ToString();
|
||||
|
||||
}
|
||||
|
||||
ObjCRM.Dispose();
|
||||
|
||||
//CARGA BITACORA
|
||||
CargaEtapasProceso(CveTipoProceso);
|
||||
@@ -731,25 +783,28 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
ClsOIEventos objBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL());
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestAcercamiento acercamiento = new RequestAcercamiento(UsuarioActual.CveEmpresa, CveAcercamiento);
|
||||
|
||||
if (ObjCRM.RemoveAcercamiento(CveAcercamiento, UsuarioActual.CveEmpresa))
|
||||
if (TieneCotizacion)
|
||||
{
|
||||
if (objBitacora.AddEventoBitacora(String.Format("Se eliminó el Acercamiento {0} de tipo {1}", NombreAcercamiento, TipoProceso), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM))
|
||||
if (cRMService.AcercamientoDelete(acercamiento))
|
||||
{
|
||||
HuboError = false;
|
||||
if (objBitacora.AddEventoBitacora(String.Format("Se eliminó el Acercamiento {0} de tipo {1}", NombreAcercamiento, TipoProceso), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEmpresaCRM: CveEmpresaCRM))
|
||||
{
|
||||
HuboError = false;
|
||||
}
|
||||
}
|
||||
if (!HuboError)
|
||||
{
|
||||
Alert("El Acercamiento ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion, String.Format("document.location.href=\"/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}\"", CveEmpresaCRM));
|
||||
}
|
||||
}
|
||||
if (!HuboError)
|
||||
{
|
||||
ObjCRM.Commit();
|
||||
Alert("El Acercamiento ha sido eliminado.", ModExtensiones.TipoMensaje.MsgInformacion, String.Format("document.location.href=\"/CRM/EmpresaCRM.aspx?CveEmpresaCRM={0}\"", CveEmpresaCRM));
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjCRM.RollBack();
|
||||
Alert("No se puede eliminar el acercamiento porque el prospecto cuenta con cotizaciones/facturaciones previas.", ModExtensiones.TipoMensaje.MsgError);
|
||||
}
|
||||
|
||||
ObjCRM.Dispose();
|
||||
objBitacora.Dispose();
|
||||
}
|
||||
#endregion
|
||||
@@ -811,7 +866,8 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
|
||||
protected void BtnRegistrarCierreCancelacion_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
//ClsCRM ObjCRM = new ClsCRM();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
//ClsOIEventos ObjBitacora = new ClsOIEventos(ObjCRM.IniciaTransacSQL());
|
||||
|
||||
//Boolean HuboError = true;
|
||||
@@ -822,7 +878,16 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
|
||||
String TituloCierre = DTEtapasProceso.FiltroPrimeroValor("EtapaProceso", "CveTipoEtapa = 4");
|
||||
|
||||
if (ObjCRM.UpdateAcercamientoCierre(CveAcercamiento, CveEtapaCierre, CveRechazoMotivo, UsuarioActual.CveUsuario, FechaCierre, Observacion))
|
||||
|
||||
AcercaminetoModel acercamiento = new AcercaminetoModel();
|
||||
acercamiento.CveAcercamiento = CveAcercamiento;
|
||||
acercamiento.CveEtapaProcesoActual = CveEtapaCierre;
|
||||
acercamiento.CveRechazoMotivo = CveRechazoMotivo;
|
||||
acercamiento.CveUsuarioIng = UsuarioActual.CveUsuario;
|
||||
acercamiento.FechaCierre = FechaCierre;
|
||||
acercamiento.ObservacionRechazo = Observacion;
|
||||
|
||||
if (cRMService.AcercamientoCierreUpdate(acercamiento))
|
||||
{
|
||||
String MensajeBitacora = "";
|
||||
if (CveEtapaActual == CveEtapaCierre)
|
||||
@@ -839,7 +904,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
|
||||
//if (!HuboError) { ObjCRM.Commit(); } else { ObjCRM.RollBack(); }
|
||||
|
||||
ObjCRM.Dispose();
|
||||
//ObjCRM.Dispose();
|
||||
//ObjBitacora.Dispose();
|
||||
|
||||
CveEtapaActual = CveEtapaCierre;
|
||||
@@ -855,23 +920,27 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
protected void CargaEtapasBitacora()
|
||||
{
|
||||
//CARGA STEP DE PASOS
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
//ClsCRM ObjCRM = new ClsCRM();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestEtapaProceso EtapaProceso = new RequestEtapaProceso(UsuarioActual.CveEmpresa, 1, CveTipoProceso);
|
||||
var ObjEtapaProceso = cRMService.GetEtapaProcesoCRM(EtapaProceso);
|
||||
|
||||
if (ObjCRM.GetEtapaProceso(UsuarioActual.CveEmpresa, CveTipoProceso, CveEstatus: 1))
|
||||
if (ObjEtapaProceso.Result.Count > 0)
|
||||
{
|
||||
TipoProceso = ObjCRM.DtResultados.FiltroPrimeroValor("TipoProceso").ToUpper();
|
||||
DataTable DTTemp = ObjEtapaProceso.Result.ToDataTable();
|
||||
TipoProceso = DTTemp.FiltroPrimeroValor("TipoProceso").ToUpper();
|
||||
int CveEtapaCierreCancelacion = DTEtapasProceso.FiltroPrimeroValor("CveEtapaProceso", "CveTipoEtapa = 4").ToEntero();
|
||||
|
||||
NumeroEtapasProceso = ObjCRM.DtResultados.FiltraParametros("CveTipoEtapa IN(1,2,3)").Rows.Count;
|
||||
NumeroEtapasProceso = DTTemp.FiltraParametros("CveTipoEtapa IN(1,2,3)").Rows.Count;
|
||||
//RptTabsEtapasProcesos.DataSource = ObjCRM.DtResultados.FiltraParametros("CveTipoEtapa IN(1,2,3)");
|
||||
|
||||
if (CveEtapaCierreCancelacion == CveEtapaActual)
|
||||
RptStepsEtapasProceso.DataSource = ObjCRM.DtResultados.FiltraParametros("CveTipoEtapa IN(1,2,4)");
|
||||
RptStepsEtapasProceso.DataSource = DTTemp.FiltraParametros("CveTipoEtapa IN(1,2,4)");
|
||||
else
|
||||
RptStepsEtapasProceso.DataSource = ObjCRM.DtResultados.FiltraParametros("CveTipoEtapa IN(1,2,3)");
|
||||
RptStepsEtapasProceso.DataSource = DTTemp.FiltraParametros("CveTipoEtapa IN(1,2,3)");
|
||||
|
||||
}
|
||||
ObjCRM.Dispose();
|
||||
//ObjCRM.Dispose();
|
||||
//RptTabsEtapasProcesos.DataBind();
|
||||
RptStepsEtapasProceso.DataBind();
|
||||
//SpanProceso.InnerText = TipoProceso + ":";
|
||||
@@ -1027,19 +1096,6 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
Archivo = null;
|
||||
}
|
||||
|
||||
protected void EliminarFile(object sender, EventArgs e)
|
||||
{
|
||||
string cveEvento = string.Format("{0}",((LinkButton)sender).CommandArgument);
|
||||
ClsOIEventos ObjEventoBitacora = new ClsOIEventos();
|
||||
ObjEventoBitacora.RemoveAgendaBitacora( cveEvento.ToEntero(), UsuarioActual.CveEmpresa);
|
||||
ObjEventoBitacora.Dispose();
|
||||
UPAddEventoBitacora.Update();
|
||||
|
||||
//RECARGAMOS GRID BITACORA
|
||||
CargaEventoBitacora(HdfEtapaSeleccionada.Value.ToEntero());
|
||||
UPBitacora.Update();
|
||||
}
|
||||
|
||||
protected void BtnGuardarEventoBitacora_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsOIEventos ObjEventoBitacora = new ClsOIEventos();
|
||||
@@ -1059,7 +1115,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
if (ObjEventoBitacora.AddEventoBitacora(TxtEventoDescripcion.Text.Trim(), string.Format(".{0}", FileExtension), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoProcesoCRM: CveTipoProceso, CveAcercamientoCRM: CveAcercamiento, CveEtapaProcesoCRM: CveEtapa))
|
||||
{
|
||||
if (filemove != "")
|
||||
filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"{0}OI", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:false);
|
||||
filemove.FilesMove(string.Format("OI{0}", ObjEventoBitacora.CveEvento.ToString()), string.Format(@"Empresas\{0}\OI", UsuarioActual.CveEmpresa));
|
||||
|
||||
|
||||
TxtEventoDescripcion.Text = "";
|
||||
@@ -1122,9 +1178,6 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
ScriptManager.GetCurrent(this).RegisterPostBackControl(e.Item.FindControl("LinkArchivo")); // Registro un evento Postbacktrigger, que recargue toda la pagina para que funcione
|
||||
|
||||
((Label)e.Item.FindControl("LblTipoArchivo")).Text = row["Archivo"].ToString().Split('.')[1].ToUpper();
|
||||
|
||||
((LinkButton)e.Item.FindControl("LinkDelete")).CommandArgument = row["CveEvento"].ToString();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1401,7 +1454,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
return _CveEncuestaAplicada;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region "MUESTRA UBICACION GEOGRAFICA"
|
||||
protected void LnkVerUbicacion_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -1416,9 +1469,13 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
protected void CargaImagenes()
|
||||
{
|
||||
var ObjCRM = new ClsCRM();
|
||||
if (ObjCRM.GetImagenesAcercamiento(CveAcercamiento))
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestImagenesAcercamiento ImagenesAcercamiento = new RequestImagenesAcercamiento(CveAcercamiento);
|
||||
|
||||
var objImagenesAcercamiento = cRMService.ImagenesAcercamientoGet(ImagenesAcercamiento);
|
||||
if (objImagenesAcercamiento.Result.Count > 0)
|
||||
{
|
||||
RptFotos.DataSource = ObjCRM.DtResultados;
|
||||
RptFotos.DataSource = objImagenesAcercamiento.Result;
|
||||
}
|
||||
ObjCRM.Dispose();
|
||||
RptFotos.DataBind();
|
||||
@@ -1429,6 +1486,9 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
bool TieneError = false;
|
||||
var ObjCRM = new ClsCRM();
|
||||
ObjCRM.IniciaTransacSQL();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestImagenesAcercamiento ImagenesAcercamiento = new RequestImagenesAcercamiento(CveAcercamiento, UsuarioActual.CveEmpresa, CveEmpresaCRM, -1, "", TxtTituloImagen.Text, TxtDescripcionImagen.Text, "-1", UsuarioActual.CveUsuario);
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var item in TxtUpFotos.getfiles().Archivos)
|
||||
@@ -1444,11 +1504,11 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
break;
|
||||
}
|
||||
|
||||
int CveArchivo = ObjCRM.AddImagenAcercamiento("", TxtTituloImagen.Text, TxtDescripcionImagen.Text, UsuarioActual.CveUsuario, CveEmpresaCRM, CveAcercamiento, UsuarioActual.CveEmpresa);
|
||||
int CveArchivo = cRMService.ImagenesAcercamientoAdd(ImagenesAcercamiento).ToEntero();
|
||||
if ((CveArchivo > 0))
|
||||
{
|
||||
string NombreNuevo = string.Format("{0}{1}", CveArchivo, FileExtension);
|
||||
string DirectorioNuevo = string.Format("{0}Acercamientos\\{1}\\Imagenes\\", UsuarioActual.Empresa.Ruta, CveAcercamiento);
|
||||
string DirectorioNuevo = string.Format("{0}\\Empresas\\{1}\\Acercamientos\\{2}\\Imagenes\\", ModExtensiones.DirectorioBaseEmpresas, UsuarioActual.CveEmpresa, CveAcercamiento);
|
||||
if (!Directory.Exists(DirectorioNuevo))
|
||||
{
|
||||
Directory.CreateDirectory(DirectorioNuevo);
|
||||
@@ -1456,7 +1516,9 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
DirectorioNuevo = DirectorioNuevo + NombreNuevo;
|
||||
var DirectorioViejo = string.Format("{0}Temp\\{1}", AppDomain.CurrentDomain.BaseDirectory, item.filename);
|
||||
|
||||
if (ObjCRM.UpdateImagenAcercamiento(CveArchivo, NombreNuevo, TxtTituloImagen.Text, TxtDescripcionImagen.Text))
|
||||
RequestImagenesAcercamiento ImagenesAcercamientoUpdate = new RequestImagenesAcercamiento(CveAcercamiento, UsuarioActual.CveEmpresa, CveEmpresaCRM, CveArchivo, NombreNuevo, TxtTituloImagen.Text, TxtDescripcionImagen.Text);
|
||||
|
||||
if (cRMService.ImagenesAcercamientoUpdate(ImagenesAcercamientoUpdate))
|
||||
{
|
||||
File.Move(DirectorioViejo, DirectorioNuevo);
|
||||
}
|
||||
@@ -1504,7 +1566,10 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
if (CveArchivo > 0)
|
||||
{
|
||||
var ObjCRM = new ClsCRM();
|
||||
bool Elimino = ObjCRM.RemoveImagenesAcercamiento(CveArchivo);
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestImagenesAcercamiento ImagenesAcercamiento = new RequestImagenesAcercamiento(-1, CveArchivo: CveArchivo);
|
||||
|
||||
bool Elimino = cRMService.ImagenesAcercamientoDelete(ImagenesAcercamiento);
|
||||
ObjCRM.Dispose();
|
||||
|
||||
if (Elimino)
|
||||
@@ -1522,9 +1587,14 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
protected void CargaCotizaciones()
|
||||
{
|
||||
ClsVentas ObjVentas = new ClsVentas();
|
||||
if (ObjVentas.GetVentas(UsuarioActual.CveEmpresa, "Cot", "-1", -1, "-1", -1, -1, -1, -1, "-1", "-1", "-1", CveEmpresaCRM: CveEmpresaCRM, CveAcercamientoCRM: CveAcercamiento, CveUsuarioConsulta: UsuarioActual.CveUsuario))
|
||||
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)
|
||||
{
|
||||
GvCotizacion.DataSource = ObjVentas.DtResultados;
|
||||
GvCotizacion.DataSource = objVentas.Result;
|
||||
TieneCotizacion = objVentas.Result.Count > 0;
|
||||
}
|
||||
ObjVentas.Dispose();
|
||||
GvCotizacion.DataBind();
|
||||
@@ -1549,9 +1619,14 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
protected void CargaGastos()
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
if (ObjCRM.GetAcercamientosGastos(CveAcercamiento))
|
||||
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestAcermientoGastos AcermientoGastos = new RequestAcermientoGastos(CveAcercamiento);
|
||||
|
||||
var objAcermientoGastos = cRMService.AcercamientosGastosGet(AcermientoGastos);
|
||||
if (objAcermientoGastos.Result.Count > 0)
|
||||
{
|
||||
GvGastos.DataSource = ObjCRM.DtResultados;
|
||||
GvGastos.DataSource = (objAcermientoGastos.Result;
|
||||
}
|
||||
ObjCRM.Dispose();
|
||||
GvGastos.DataBind();
|
||||
@@ -1576,10 +1651,11 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
protected void BtnAgregarGastoModal_Click(object sender, EventArgs e)
|
||||
{
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
|
||||
if(!Actualizar)
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
RequestAcermientoGastos AcermientoGastos = new RequestAcermientoGastos(CveAcercamiento, -1, TxtDescripcionGasto.Text, TxtImporteGasto.Text.ToDecimal(), UsuarioActual.CveUsuario);
|
||||
if (!Actualizar)
|
||||
{
|
||||
if (ObjCRM.AddAcercamientosGastos(CveAcercamiento, TxtDescripcionGasto.Text, TxtImporteGasto.Text.ToDecimal(), UsuarioActual.CveUsuario))
|
||||
if (cRMService.AcercamientosGastosAdd(AcermientoGastos))
|
||||
{
|
||||
CargaGastos();
|
||||
|
||||
@@ -1593,7 +1669,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ObjCRM.UpdateAcercamientosGastos(CveAcercamientoGasto, TxtDescripcionGasto.Text, TxtImporteGasto.Text.ToDecimal()))
|
||||
if (cRMService.AcercamientosGastosUpdate(AcermientoGastos))
|
||||
{
|
||||
CargaGastos();
|
||||
|
||||
@@ -1647,10 +1723,11 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
{
|
||||
|
||||
ClsCRM ObjCRM = new ClsCRM();
|
||||
ICRMService cRMService = new CRMService(System.Configuration.ConfigurationManager.ConnectionStrings["Conexion"].ConnectionString);
|
||||
GridViewRow GvRow = (GridViewRow)((LinkButton)sender).NamingContainer;
|
||||
CveAcercamientoGasto = GvRow.DataKey("CveAcercamientoGasto").ToEntero();
|
||||
|
||||
if (ObjCRM.RemoveAcercamientosGastos(CveAcercamientoGasto))
|
||||
RequestAcermientoGastos AcermientoGastos = new RequestAcermientoGastos(CveAcercamiento, CveAcercamientoGasto: CveAcercamientoGasto);
|
||||
if (cRMService.AcercamientosGastosDelete(AcermientoGastos))
|
||||
{
|
||||
CargaGastos();
|
||||
Alert("Gasto eliminado Correctamente", ModExtensiones.TipoMensaje.MsgInformacion);
|
||||
|
||||
Reference in New Issue
Block a user