Пример #1
0
        public void RegistrarMotivoFaseColgateBodega_Mov(E_MotivoFase oE_MotivoFase, string id_MotivoFase)
        {
            try
            {
                //#region Eliminar Detalle MotivoFase en Xplora >>>>Warning - Metodo no Implementado<<<<
                //oCoon = new Conexion(1);
                //oCoon.ejecutarSinRetorno("SP_XPL_GES_OPE_ELIMINAR_MOTIVOFASE_DETALLE", id_MotivoFase);
                //#endregion


                oCoon = new Conexion(3);
                oCoon.ejecutarSinRetorno("SP_MOV_GES_OPE_REGISTRAR_MOTIVOFASE_DETALLE", id_MotivoFase, oE_MotivoFase.CodMotivo);
            }
            catch (Exception ex) {
                throw ex;
            }
        }
        /// <summary>
        /// Descripcion :Asignar al Mercaderista la Ruta.
        /// Fecha       :06/05/2012 PSA
        /// </summary>
        /// <param name="oE_Reporte"></param>
        /// <param name="Cod_POSPlanning"></param>
        private int Registrar_PDV_Planning_Oper(E_Reporte_RegistroPDV_Mov oE_Reporte, string Id_MPOSPlanning, string ClientPDV_Code)
        {
            int correcto = 1;

            try
            {
                D_Reporte_Presencia oD_Reporte_Presencia = new D_Reporte_Presencia();
                D_Registrar_Motivo  oD_Registrar_Motivo  = new D_Registrar_Motivo();

                #region Registrar Ruta en Xplora
                oCoon = new Conexion(1);
                oCoon.ejecutarDataTable("SP_XPL_GES_CAM_INSERTARPDVPLANNING_OPER"
                                        , Id_MPOSPlanning
                                        , oE_Reporte.Cod_Equipo
                                        , oE_Reporte.Cod_Persona
                                        , oE_Reporte.Fecha_Registro //Fecha_Inicio del Relevo
                                        , null                      // Cod Frecuencia
                                        , false                     // Estado
                                        , oE_Reporte.Creado_Por
                                        , oE_Reporte.Fecha_Registro
                                        , ClientPDV_Code);
                #endregion

                #region Registrar Ruta en Intermedia -- Comentado Psa 23/10/2012
                //oCoon = new Conexion(3);
                //oCoon.ejecutarDataSet("SP_MOV_GES_CAM_REGISTRAR_RUTA"
                //    , oE_Reporte.Cod_Equipo
                //    , ClientPDV_Code ?? null
                //    , oE_Reporte.Cod_Persona ?? null
                //    , oE_Reporte.Fecha_Registro ?? null //Fecha Inicio Ruta
                //    , null   //Fecha Fin Ruta
                //    , 1      //Estado
                //    );
                #endregion

                #region Registrar Ruta con Fase en Xplora - >>>>>Warning<<<<<<<<
                #endregion

                #region Registrar Ruta con Fase en Intermedia -- Comentado Psa 23/10/2012
                oCoon = new Conexion(3);
                oCoon.ejecutarDataSet("SP_MOV_GES_CAM_REGISTRAR_RUTA_FASE"
                                      , ClientPDV_Code
                                      , oE_Reporte.Cod_Equipo
                                      , "NI" //Fase NI
                                      );
                #endregion

                #region Registrar Presencia en BD Intermedia con Fase

                E_Reporte_Presencia_Mov oE_Reporte_Presencia_Mov = new E_Reporte_Presencia_Mov();
                oE_Reporte_Presencia_Mov.Cod_Equipo    = oE_Reporte.Cod_Equipo;
                oE_Reporte_Presencia_Mov.Cod_Compania  = int.Parse(oE_Reporte.Cod_Compania);
                oE_Reporte_Presencia_Mov.Cod_PtoVenta  = ClientPDV_Code;
                oE_Reporte_Presencia_Mov.Cod_Persona   = int.Parse(oE_Reporte.Cod_Persona);
                oE_Reporte_Presencia_Mov.FechaRegistro = oE_Reporte.Fecha_Registro;
                oE_Reporte_Presencia_Mov.Latitud       = oE_Reporte.Latitud;
                oE_Reporte_Presencia_Mov.Longitud      = oE_Reporte.Longitud;
                oE_Reporte_Presencia_Mov.Origen        = oE_Reporte.Origen;
                oE_Reporte_Presencia_Mov.Fase          = "NI";
                oE_Reporte_Presencia_Mov.Nuevo         = "1";

                oD_Reporte_Presencia.Registrar_Presencia_Mov_Cabecera(oE_Reporte_Presencia_Mov, 0);

                #endregion

                #region Regisrar Motivos - No Implementación o No Mantenimiento en BD Intermedia

                E_MotivoFase oE_MotivoFase = new E_MotivoFase();
                oE_MotivoFase.CodMotivo = 93;//Motivo de No Implementación, 93 - Por Implementar.

                E_Registro_MotivoFase oE_Registro_MotivoFase = new E_Registro_MotivoFase();
                oE_Registro_MotivoFase.Cod_Persona   = int.Parse(oE_Reporte.Cod_Persona);
                oE_Registro_MotivoFase.Cod_PtoVenta  = ClientPDV_Code;
                oE_Registro_MotivoFase.Cod_Equipo    = oE_Reporte.Cod_Equipo;
                oE_Registro_MotivoFase.Cod_Compania  = int.Parse(oE_Reporte.Cod_Compania);
                oE_Registro_MotivoFase.FechaRegistro = oE_Reporte.Fecha_Registro;
                oE_Registro_MotivoFase.Origen        = oE_Reporte.Origen;
                oE_Registro_MotivoFase.Latitud       = oE_Reporte.Latitud;
                oE_Registro_MotivoFase.Longitud      = oE_Reporte.Longitud;
                oE_Registro_MotivoFase.Fase          = "NI";
                oE_Registro_MotivoFase.Nuevo         = "1";
                oE_Registro_MotivoFase.listaMotivo.Add(oE_MotivoFase);

                oD_Registrar_Motivo.RegistrarMotivoColgateBodega_Mov(oE_Registro_MotivoFase);

                #endregion
            }
            catch (Exception ex) {
                correcto = 0;
                throw ex;
            }
            return(correcto);
        }