Exemplo n.º 1
0
        public static clsParametrosInfo ListarParametrosPorTipo(Enums.TipoParametro Parametro)
        {
            clsParametrosInfo paramInfo = new clsParametrosInfo();

            SqlDataReader objReader = null;

            SqlParameter[] objParams;

            try {
                objParams          = SqlHelperParameterCache.GetSpParameterSet(BaseDatos.GetConexion(), "SP_C_PARAM_PARAMETROS_POR_TIPO");
                objParams[0].Value = (int)Parametro;

                objReader = SqlHelper.ExecuteReader(BaseDatos.GetConexion(), "SP_C_PARAM_PARAMETROS_POR_TIPO", objParams);
                while (objReader.Read())
                {
                    paramInfo.AddItem(AgregarItemLista(objReader, Parametro));
                }
            } catch (Exception ex) {
                Base.Log.Log.EscribirLog(ex.Message);
                return(null);
            } finally {
                if (objReader != null)
                {
                    objReader.Close();
                }
            }
            return(paramInfo);
        }
Exemplo n.º 2
0
        private void CargarCbosParametroTipoContenedor()
        {
            clsParametrosInfo lstTipoContenedores =
                clsParametros.ListarParametrosPorTipo(Enums.TipoParametro.TipoContenedor);

            Utils.Utils.CargaComboBoxParametros(lstTipoContenedores, this.lstTipoContenedor);
        }
Exemplo n.º 3
0
 private void CargarTerminosCompras()
 {
     clsParametrosInfo TerminosCompra = clsParametros.ListarParametrosPorTipo(Enums.TipoParametro.TerminioCompra);
     lstTerminosCompra.Items.Clear();
     foreach (var item in TerminosCompra.Items)
         lstTerminosCompra.Items.Add(item);
 }
Exemplo n.º 4
0
        public static void CargaComboBoxParametros(clsParametrosInfo lista, ComboBoxEdit combo)
        {
            ComboBoxItemCollection coll = combo.Properties.Items;

            coll.Add(ObtenerPrimerItem());

            foreach (var list in lista.Items)
            {
                coll.Add(list);
            }
            combo.SelectedIndex = 0;
        }
Exemplo n.º 5
0
        private void CargarTerminosCompras()
        {
            clsParametrosInfo        TerminosCompra      = clsParametros.ListarParametrosPorTipo(Enums.TipoParametro.TerminioCompra);
            IList <clsItemParametro> ListaTerminosCompra = new List <clsItemParametro>();

            foreach (var item in TerminosCompra.Items)
            {
                ListaTerminosCompra.Add(item);
            }
            lstTerminosCompra.DataSource = null;
            lstTerminosCompra.DataSource = ListaTerminosCompra;
        }
Exemplo n.º 6
0
 private void CargarCbosParametros()
 {
     try
     {
         clsParametrosInfo lstSaludos = clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.TipoSaludo);
         Utils.Utils.CargaComboBoxParametros(lstSaludos, this.cboSaludo);
         /**************************************************/
         clsParametrosInfo lstEstadoCivil = clsParametros.ListarParametrosPorTipo(Enums.TipoParametro.EstadoCivil);
         Utils.Utils.CargaComboBoxParametros(lstEstadoCivil, cboEstadoCivil);
         /**************************************************/
         clsParametrosInfo lstSexos = clsParametros.ListarParametrosPorTipo(Enums.TipoParametro.Sexo);
         Utils.Utils.CargaComboBoxParametros(lstSexos, cboSexo);
         /**************************************************/
         clsParametrosInfo lstRoles = clsParametros.ListarParametrosPorTipo(Enums.TipoParametro.TiposRol);
         Utils.Utils.CargaComboBoxParametros(lstRoles, cboRol);
         /**************************************************/
         clsParametrosInfo lstTipoDireccion =
             clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.TipoDireccion);
         Utils.Utils.CargaComboBoxParametros(lstTipoDireccion, this.cboTipoDireccion);
         /**************************************************/
         clsParametrosInfo lstDestinoDireccion =
             clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.DestinoDireccion);
         Utils.Utils.CargaComboBoxParametros(lstDestinoDireccion, this.cboDestinoDireccion);
         /**************************************************/
         clsParametrosInfo lstSectoresDireccion =
             clsParametros.ListarParametrosPorTipo(Enums.TipoParametro.SectorDireccion);
         Utils.Utils.CargaComboBoxParametros(lstSectoresDireccion, cboTipoZona);
         /**************************************************/
         clsParametrosInfo lstFormaContPref =
             clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.FormasContacto);
         Utils.Utils.CargaComboBoxParametros(lstFormaContPref, this.cboFormaContactoPref);
         /**************************************************/
         //Utils.Utils.CargaComboBoxEnumDias(this.cboDiaPreferido);
         clsParametrosInfo lstDias =
             clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.Dias);
         Utils.Utils.CargaComboBoxParametros(lstDias, this.cboDiaPref);
         /**************************************************/
         //Utils.Utils.CargaComboBoxEnumJornada(this.cboJornadaPreferida);
         clsParametrosInfo lstJornadas =
             clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.Jornada);
         Utils.Utils.CargaComboBoxParametros(lstJornadas, cboJornadaPref);
         /**************************************************/
         clsParametrosInfo lstDepartamentos =
             clsParametros.ListarParametrosPorTipo(Enums.TipoParametro.TipoDepartamentoContacto);
         Utils.Utils.CargaComboBoxParametros(lstDepartamentos, cboDepartamento);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 7
0
        private void CargarUnidadesDeMedida()
        {
            clsParametrosInfo UMLCL =
                clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.UnidadMedidaLCL);
            Utils.Utils.CargaComboBoxParametros(UMLCL, cboUMLCL);

            clsParametrosInfo UMFCL =
                                clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.UnidadMedidaFCL);
            Utils.Utils.CargaComboBoxParametros(UMFCL, cboUMFCL);

            clsParametrosInfo UMAereo =
                clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.UnidadMedidaAereo);
            Utils.Utils.CargaComboBoxParametros(UMAereo, cboUMAereo);
        }
Exemplo n.º 8
0
        private void schedulerControl1_AppointmentDrop(object sender, AppointmentDragEventArgs e)
        {
            string createEventMsg = "Crear el evento a las {0} el dia {1}.";
            string moveEventMsg   = "Mover el evento desde {0} el dia {1} a las {2} el dia {3}.";

            bool Crear = false;
            bool Mover = false;


            DateTime srcStart = e.SourceAppointment.Start;
            DateTime newStart = e.EditedAppointment.Start;

            string msg = (srcStart == DateTime.MinValue) ? String.Format(createEventMsg, newStart.ToShortTimeString(), newStart.ToShortDateString()) :
                         String.Format(moveEventMsg, srcStart.ToShortTimeString(), srcStart.ToShortDateString(), newStart.ToShortTimeString(), newStart.ToShortDateString());


            if (msg.Contains("Crear"))
            {
                Crear = true;
            }

            if (msg.Contains("Mover"))
            {
                Mover = true;
            }

            clsVisita visita = new clsVisita();

            if (Mover)
            {
                if (!PermitirModificarVisita(e.SourceAppointment))
                {
                    e.Allow   = false;
                    e.Handled = true;
                    return;
                }
            }


            if (XtraMessageBox.Show(msg + "\r\nProceder?", "Mi Calendario", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                e.Allow   = false;
                e.Handled = true;
                return;
            }



            if (Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"]) > 0)
            {
                if (Mover)
                {
                    visita =
                        LogicaNegocios.Calendarios.clsCalendarios.ObtenerVisitaPorId(
                            Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"]));
                }

                //visita.Id = Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"]);
                //visita.Asunto = e.SourceAppointment.Subject;
                //visita.Descripcion = e.SourceAppointment.Description;
                //visita.Ubicacion = e.SourceAppointment.Location;
                visita.FechaHoraComienzo = e.EditedAppointment.Start;
                visita.FechaHoraTermino  = e.EditedAppointment.End;
            }
            else
            {
                visita.Id                = Convert.ToInt64(e.SourceAppointment.CustomFields["IdVisita"]);
                visita.Asunto            = e.SourceAppointment.Subject;
                visita.Descripcion       = e.SourceAppointment.Description;
                visita.Ubicacion         = e.SourceAppointment.Location;
                visita.FechaHoraComienzo = e.EditedAppointment.Start;
                visita.FechaHoraTermino  = e.EditedAppointment.End;
            }

            if (Crear)
            {
                visita.Cliente  = LogicaNegocios.Clientes.clsClientesMaster.ObtenerClienteMasterPorId(IdClienteDraw);
                visita.EstadoBD = Entidades.Enums.Enums.VisitaEstado.Incompleta;

                if (visita.Cliente.Tipo == Enums.TipoPersona.Cuenta)
                {
                    ResultadoTransaccion resCuenta = LogicaNegocios.Clientes.clsCuentas.ObtenerCuentaPorIdMaster(visita.Cliente.Id);
                    clsCuenta            cuenta    = new clsCuenta();
                    if (resCuenta.Estado == Enums.EstadoTransaccion.Aceptada)
                    {
                        cuenta = (clsCuenta)resCuenta.ObjetoTransaccion;
                    }

                    if (cuenta != null)
                    {
                        visita.Vendedor = cuenta.VendedorAsignado;
                    }
                }
                else if (visita.Cliente.Tipo == Enums.TipoPersona.Target)
                {
                    ResultadoTransaccion resCuenta =
                        LogicaNegocios.Clientes.clsTarget.ObtenerTargetPorIdMaster(visita.Cliente.Id);

                    clsTarget target = new clsTarget();
                    if (resCuenta.Estado == Enums.EstadoTransaccion.Aceptada)
                    {
                        target = (clsTarget)resCuenta.ObjetoTransaccion;
                    }

                    if (target != null)
                    {
                        visita.Vendedor = target.VendedorAsignado;
                    }
                }


                clsVisitaAsistente asistente = new clsVisitaAsistente();
                asistente.Usuario       = Base.Usuario.UsuarioConectado.Usuario;
                asistente.TipoAsistente = Entidades.Enums.Enums.VisitaTipoAsistente.Usuario;
                visita.Asistentes.Add(asistente);

                clsParametrosInfo paraminfo = LogicaNegocios.Parametros.clsParametros.ListarParametrosPorTipo(Entidades.Enums.Enums.TipoParametro.ImportanciaVisita);
                visita.NivelImportancia = paraminfo.Items[0];  // Entidades.Enums.Enums.VisitaNivelImportancia.Baja;
            }


            //visita.Vendedor = Base.Usuario.UsuarioConectado.Usuario;

            visita.UsuarioOrganizador = Base.Usuario.UsuarioConectado.Usuario;
            Entidades.GlobalObject.ResultadoTransaccion res = LogicaNegocios.Calendarios.clsCalendarios.GuardarVisita(visita);

            if (res.Estado == Entidades.Enums.Enums.EstadoTransaccion.Aceptada)
            {
            }
            else
            {
                MessageBox.Show(res.Descripcion, "Calendario", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.Allow   = false;
                e.Handled = true;
                return;
            }

            PopupClientes.Visible = false;

            //if(schedulerStorage1.Appointments.IsNewAppointment(e.EditedAppointment))
            //{
            //    schedulerStorage1.Appointments.Add(e.EditedAppointment);
            //}

            //SincronizarOutlook();
        }
Exemplo n.º 9
0
        public static clsParametrosInfo ListarParametrosPorTipo(Enums.TipoParametro Parametro)
        {
            clsParametrosInfo paramInfo = new clsParametrosInfo();

            SqlDataReader objReader = null;
            SqlParameter[] objParams;

            try {
                objParams = SqlHelperParameterCache.GetSpParameterSet(BaseDatos.GetConexion(), "SP_C_PARAM_PARAMETROS_POR_TIPO");
                objParams[0].Value = (int)Parametro;

                objReader = SqlHelper.ExecuteReader(BaseDatos.GetConexion(), "SP_C_PARAM_PARAMETROS_POR_TIPO", objParams);
                while (objReader.Read()) {
                    paramInfo.AddItem(AgregarItemLista(objReader, Parametro));
                }
            } catch (Exception ex) {
                Base.Log.Log.EscribirLog(ex.Message);
                return null;

            } finally {
                if (objReader != null) objReader.Close();
            }
            return paramInfo;
        }