CRM Check list
This commit is contained in:
@@ -5,11 +5,14 @@ using ADSNetLibrary.SIGAPI.Models.Ventas.Request;
|
||||
using ADSNetLibrary.SIGAPI.Services;
|
||||
using ADSNetLibrary.SIGAPI.Services.CRM;
|
||||
using ADSNetLibrary.SIGAPI.Services.Encuestas;
|
||||
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
||||
using Extensiones;
|
||||
using FormulaEvaluator;
|
||||
using MoreLinq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
@@ -266,6 +269,10 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
ViewState["TieneCotizacion"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
//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; } }
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
@@ -300,6 +307,8 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
DivMensajeDatosTecnicos.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
CargaCheckLis();
|
||||
}
|
||||
CargarPS();
|
||||
}
|
||||
@@ -334,7 +343,7 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
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.ToString().ToDate() == ModExtensiones.MinFecha ? "" : objAcercamiento.Result[0].FechaCierre.ToDateTime().ToShortDateString();
|
||||
TxtFechaCierre.Text = (objAcercamiento.Result[0].FechaCierre.ToString() == "") || objAcercamiento.Result[0].FechaCierre.ToString().ToDate() == ModExtensiones.MinFecha ? "" : 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);
|
||||
@@ -1814,4 +1823,135 @@ public partial class CRM_Acercamiento : ClsPaginas
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region "CHECK LIST"
|
||||
|
||||
|
||||
private void CargaCheckLis()
|
||||
{
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
if (objOI.Getcheklist(-1, CveAcercamiento: CveAcercamiento))
|
||||
{
|
||||
GVcheklist.DataSource = objOI.DtResultados;
|
||||
GVcheklist.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
UpChkList.Update();
|
||||
}
|
||||
|
||||
protected void LnkAgregarchklistitem_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (TxtActividad.Text.Trim().Length > 0)
|
||||
{
|
||||
if (CveAcercamiento > 0)
|
||||
{
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
if (objOI.Addcheklist(-1, TxtActividad.Text, UsuarioActual.CveUsuario, CveAcercamiento: CveAcercamiento))
|
||||
{
|
||||
Alert("Se agregó la actividad", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
if (objOI.Getcheklist(-1, CveAcercamiento: CveAcercamiento))
|
||||
{
|
||||
GVcheklist.DataSource = objOI.DtResultados;
|
||||
GVcheklist.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Data.DataRow drow = CheckListNew.NewRow();
|
||||
drow["CveEventoCheckList"] = chklistitemindex++;
|
||||
drow["EventoComentario"] = TxtActividad.Text;
|
||||
drow["Estatus"] = false;
|
||||
//CveEventoCheckList,CveEvento,CveTipoEvento,EventoComentario,Estatus,CveUsuario,Usuario,FechaIng
|
||||
CheckListNew.Rows.Add(drow);
|
||||
GVcheklist.DataSource = CheckListNew;
|
||||
GVcheklist.DataBind();
|
||||
}
|
||||
}
|
||||
TxtActividad.Focus();
|
||||
TxtActividad.Text = "";
|
||||
}
|
||||
|
||||
|
||||
protected void ChkEstatus_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
CheckBox chk = (CheckBox)sender;
|
||||
GridViewRow gvrow = (GridViewRow)chk.NamingContainer;
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
if (objOI.Upcheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), gvrow.DataKey("EventoComentario"), chk.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
|
||||
CveAcercamiento: CveAcercamiento))
|
||||
{
|
||||
//ObjEventosCorreo o = objOI.objCorreo;
|
||||
Alert("Se actualizó el estatus de la actividad", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
if (objOI.Getcheklist(-1, CveAcercamiento: CveAcercamiento))
|
||||
{
|
||||
GVcheklist.DataSource = objOI.DtResultados;
|
||||
GVcheklist.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void LnkEliminarchek_Click(object sender, EventArgs e)
|
||||
{
|
||||
GridViewRow gvrow = (GridViewRow)((LinkButton)sender).NamingContainer;
|
||||
|
||||
if(!(CveAcercamiento > 0))
|
||||
{
|
||||
CheckListNew = CheckListNew.FiltraParametros(string.Format("CveEventoCheckList <> {0}", gvrow.DataKey("CveEventoCheckList")));
|
||||
GVcheklist.DataSource = CheckListNew;
|
||||
GVcheklist.DataBind();
|
||||
}
|
||||
else
|
||||
{
|
||||
using (ClsOIEventos objOI = new ClsOIEventos())
|
||||
{
|
||||
if (objOI.Removecheklist(gvrow.DataKey("CveEventoCheckList").ToEntero(), gvrow.DataKey("CveEvento").ToEntero(), UsuarioActual.CveUsuario, CveAcercamiento: CveAcercamiento))
|
||||
{
|
||||
Alert("Se ha eliminadó la actividad", ModExtensiones.TipoMensaje.ToastInformacion);
|
||||
if (objOI.Getcheklist(-1, CveAcercamiento))
|
||||
{
|
||||
GVcheklist.DataSource = objOI.DtResultados;
|
||||
GVcheklist.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void LnkSinfuncion_Click(object sender, EventArgs e)
|
||||
{
|
||||
// es para mandar llamar el ChkEstatus_CheckedChanged
|
||||
}
|
||||
|
||||
|
||||
|
||||
//private bool GuardaCheckList(SqlTransaction transaction, int CveAcercamientoNuevo)
|
||||
//{
|
||||
// bool respuesta = true;
|
||||
|
||||
// ClsOIEventos objOI = new ClsOIEventos(transaction);
|
||||
|
||||
// foreach (GridViewRow GvRow in GVcheklist.Rows)
|
||||
// {
|
||||
// if (!objOI.Addcheklist(-1, TxtActividad.Text, UsuarioActual.CveUsuario, CveAcercamiento: CveAcercamiento))
|
||||
// {
|
||||
// respuesta = false;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// return respuesta;
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user