예제 #1
0
 public GuestInvitationRules(EnumModule module, UserData user, int guId = 0)
 {
     _user         = user;
     _guID         = guId;
     _module       = module;
     _fromFrmGuest = true;
 }
예제 #2
0
 public GuestInvitationRules(EnumModule module, EnumInvitationType invitationType, UserData user, int guId = 0)
 {
     _module         = module;
     _invitationType = invitationType;
     _user           = user;
     _guID           = guId;
 }
예제 #3
0
        /// <summary>
        /// Carga el Program para la invitacion
        /// </summary>
        /// <param name="module">EnumModule</param>
        /// <param name="invitationType">EnumInvitationType</param>
        /// <param name="guId">GuestID</param>
        /// <history>
        /// [erosado] 10/08/2016  Created.
        /// </history>
        private async Task LoadProgram(EnumModule module, EnumInvitationType invitationType, int guId)
        {
            EnumProgram program = EnumProgram.All;

            //Si se tiene el GuestID
            if (guId != 0 && module != EnumModule.Host)
            {
                //Obtenemos la informacion del Guest
                var guest = await BRGuests.GetGuest(guId);

                //Obtenemos la informacion de program
                var result = await BRLeadSources.GetLeadSourceProgram(guest.gulsOriginal);

                //Asignamos el Program
                if (result == EnumToListHelper.GetEnumDescription(EnumProgram.Inhouse))
                {
                    program = EnumProgram.Inhouse;
                }
                else
                {
                    program = EnumProgram.Outhouse;
                }
            }
            //Si NO hay un Guest para obtener el program
            else
            {
                //De que modulo me estan hablando
                switch (module)
                {
                case EnumModule.InHouse:
                    if (invitationType == EnumInvitationType.newExternal)
                    {
                        program = EnumProgram.Inhouse;
                    }
                    break;

                case EnumModule.OutHouse:
                    if (invitationType == EnumInvitationType.newOutHouse)
                    {
                        program = EnumProgram.Outhouse;
                    }
                    break;

                case EnumModule.Host:
                    if (invitationType == EnumInvitationType.newOutHouse)
                    {
                        program = EnumProgram.Outhouse;
                    }
                    else
                    {
                        program = EnumProgram.Inhouse;
                    }
                    break;
                }
            }
            Program         = program;
            AllowReschedule = program == EnumProgram.Inhouse;
        }
예제 #4
0
 public frmGuest(UserData user, int guestId, EnumModule module, EnumProgram program, EnumMode mode, bool isInvitation)
 {
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     _user         = user;
     _guestId      = guestId;
     _module       = module;
     _program      = program;
     _mode         = mode;
     _isInvitation = isInvitation;
     InitializeComponent();
 }
예제 #5
0
        /// <summary>
        /// Carga al personal dependiendo del tipo de invitacion
        /// </summary>
        /// <param name="user">UserData</param>
        /// <param name="module">EnumModule</param>
        /// <history>
        /// [erosado] 09/08/2016
        /// </history>
        private async Task LoadPersonnel(UserData user, EnumModule module)
        {
            List <PersonnelShort> personnel;

            //Si es Host carga al personal con la sala de venta
            if (module == EnumModule.Host)
            {
                personnel = await BRPersonnel.GetPersonnel(salesRooms : user.SalesRoom.srID, roles : "PR");
            }
            //Si es cualquier otro lo hace con el leadSource
            else
            {
                personnel = await BRPersonnel.GetPersonnel(user.LeadSource.lsID, roles : "PR");
            }
            Personnel = personnel;
        }
예제 #6
0
        public static AutoUpdate GetVersionNew(EnumModule module)
        {
            var entity = new AutoUpdate();

            try
            {
                var dt = Inst.ExeStore("SP_AutoUpdate_GetVersionNew", module.ToString()).ToList <AutoUpdate>();
                if (dt.Count == 1)
                {
                    entity = dt.First();
                }
            }
            catch
            {
            }
            return(entity);
        }
예제 #7
0
        public static AppConfig GetGeneralConfig()
        {
            var configRoot = (new ConfigurationBuilder())
                             .SetBasePath(Directory.GetCurrentDirectory())
                             .AddJsonFile("appsettings.json")
                             .Build();

            // read the config settings from the appsettings.json file
            string environment                = configRoot.GetValue <string>("App.Environment")?.Trim();
            string restrictUsersTo            = configRoot.GetValue <string>("App.RestrictUsersTo")?.Trim();
            string enablePerformanceProfiling = configRoot.GetValue <string>("App.PerformanceProfiling.Enabled")?.Trim();
            string path_tempWorkingDir        = configRoot.GetValue <string>("Path.TempWorkingDir")?.Trim();

            var config = new AppConfig();

            config.Environment                = EnumModule.EnumFromString <RunningEnvironment>(environment) ?? RunningEnvironment.Dev;
            config.RestrictedUsers            = restrictUsersTo?.Split(',').Select(s => s.Trim().ToUpper()).ToArray() ?? new string[0];
            config.EnablePerformanceProfiling = StringModule.ToBool(enablePerformanceProfiling, false);
            config.Path_TempWorkingDir        = path_tempWorkingDir.IfEmpty(@"C:\Temp\TempWorkingDir");

            return(config);
        }
예제 #8
0
        /// <summary>
        /// Formato para el reporte Guest Manifest Range de Host y Processor General
        /// </summary>
        /// <param name="module">Modulo desde donde se genera el reporte</param>
        /// <history>
        /// [edgrodriguez] 13/Jun/2016 Created
        /// [wtorres]      30/Sep/2016 Modified. Agregue el parametro module
        /// </history>
        public static ColumnFormatList RptManifestRangeByLs(EnumModule module)
        {
            //Hay columnas que no se deben desplegar en el manifiesto del modulo Host para ahorrar espacio
            bool isVisible = (module == EnumModule.ProcessorGeneral);

            ColumnFormatList lst = new ColumnFormatList();

            lst.Add("Date", "DateManifest", EnumFormatTypeExcel.Date, isVisible: isVisible);
            lst.Add("Group", "SaleTypeN", isGroup: true, isVisible: isVisible);
            lst.Add("LocationN", "LocationN", isGroup: true, isVisible: false);
            lst.Add("ShowProgram", "ShowProgramN", isGroup: true, isVisible: false);
            lst.Add("SR", "SalesRoom", isVisible: isVisible);
            lst.Add("LS", "LeadSource", isVisible: isVisible);
            lst.Add("GUID", "guID", width: 7);
            lst.Add("Last Name", "LastName", width: 12, wordWrap: true);
            lst.Add("First Name", "FirstName", width: 12, wordWrap: true);
            lst.Add("Country", "CountryD", width: 18, fontSize: 6, wordWrap: true);
            lst.Add("Show D", "ShowD", EnumFormatTypeExcel.Date, isVisible: isVisible);
            lst.Add("Hotel", "Hotel", width: 11, fontSize: 6, wordWrap: true);
            lst.Add("Room", "Room", width: 8);
            lst.Add("Agency", "AgencyN", fontSize: 6, wordWrap: true);
            lst.Add("Pax", "Pax", EnumFormatTypeExcel.DecimalNumber, function: DataFieldFunctions.Sum, width: 7);
            lst.Add("In", "TimeInT", EnumFormatTypeExcel.Time, width: 8);
            lst.Add("Out", "TimeOutT", EnumFormatTypeExcel.Time, width: 8);
            lst.Add("Host", "Hostess", width: 6);
            lst.Add("Sh", "Show", EnumFormatTypeExcel.Boolean, function: DataFieldFunctions.Count, width: 4);
            lst.Add("Tour", "Tour", EnumFormatTypeExcel.Boolean, function: DataFieldFunctions.Count, width: 6);
            lst.Add("IO", "IO", EnumFormatTypeExcel.Boolean, function: DataFieldFunctions.Count, width: 4);
            lst.Add("WO", "WO", EnumFormatTypeExcel.Boolean, function: DataFieldFunctions.Count, width: 4);
            lst.Add("CT", "CTour", EnumFormatTypeExcel.Boolean, function: DataFieldFunctions.Count, width: 4);
            lst.Add("Sv", "STour", EnumFormatTypeExcel.Boolean, function: DataFieldFunctions.Count, width: 4);
            lst.Add("D", "Direct", EnumFormatTypeExcel.Boolean, function: DataFieldFunctions.Count, width: 4);
            lst.Add("R", "Resch", EnumFormatTypeExcel.Boolean, function: DataFieldFunctions.Count, width: 4);
            lst.Add("N°", "PR1", width: 8);
            lst.Add("PR/SG", "PR1N", fontSize: 6, wordWrap: true);
            lst.Add("N°", "Liner1", width: 8);
            lst.Add("Sales R.", "Liner1N", fontSize: 6, wordWrap: true);
            lst.Add("N°", "Closer1", width: 8);
            lst.Add("FM1", "Closer1N", fontSize: 6, wordWrap: true);
            lst.Add("N°", "Closer2", width: 8);
            lst.Add("FM2", "Closer2N", fontSize: 6, wordWrap: true);
            lst.Add("N°", "Exit1", width: 8);
            lst.Add("JRFM", "Exit1N", fontSize: 6, wordWrap: true);
            lst.Add("Aff", "saMembershipNum", width: 7);
            lst.Add("Sale", "ProcSales", EnumFormatTypeExcel.Number, function: DataFieldFunctions.Sum, width: 6);
            lst.Add("Proc Orig", "ProcOriginal", EnumFormatTypeExcel.Currency, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("Proc New", "ProcNew", EnumFormatTypeExcel.Currency, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("Proc Gross", "ProcGross", EnumFormatTypeExcel.Currency, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("Sale", "PendSales", EnumFormatTypeExcel.Number, function: DataFieldFunctions.Sum, width: 6);
            lst.Add("Pend Original", "PendOriginal", EnumFormatTypeExcel.Currency, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("Pend New", "PendNew", EnumFormatTypeExcel.Currency, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("Pend Gross", "PendGross", EnumFormatTypeExcel.Currency, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("$ DP", "saDownPayment", EnumFormatTypeExcel.Currency, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("% DP", "saDownPaymentPercentage", EnumFormatTypeExcel.Percent, isCalculated: true, formula: "IF([ProcGross]=0,IF([PendGross]=0,0,[saDownPayment]/[PendGross]),[saDownPayment]/[ProcGross])", width: 6);
            lst.Add("$ EDP", "saDownPaymentPaid", EnumFormatTypeExcel.Currency, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("% EDP", "saDownPaymentPaidPercentage", EnumFormatTypeExcel.Percent, isCalculated: true, formula: "IF([ProcGross]=0,IF([PendGross]=0,0,[saDownPaymentPaid]/[PendGross]),[saDownPaymentPaid]/[ProcGross])", width: 7);
            lst.Add("Deposit Sale", "DepositSale", EnumFormatTypeExcel.DecimalNumber, function: DataFieldFunctions.Sum, width: 13);
            lst.Add("Deposit #", "DepositSaleNum", width: 10);
            lst.Add("CC", "CC", width: 5, fontSize: 6, wordWrap: true);
            lst.Add("Comments", "Comments", width: 15, fontSize: 6, wordWrap: true);
            lst.Add("SaleType", "SaleType", isVisible: false);
            lst.Add("Location", "Location", isVisible: false);
            lst.Add("Sequency", "Sequency", isVisible: false);
            lst.Add("Agency ID", "Agency", isVisible: false);
            lst.Add("Country ID", "Country", isVisible: false);
            lst.Add("PR 2", "PR2", isVisible: false);
            lst.Add("PR 2 Name", "PR2N", isVisible: false);
            lst.Add("PR 3", "PR3", isVisible: false);
            lst.Add("PR 3 Name", "PR3N", isVisible: false);
            lst.Add("Liner 2", "Liner2", isVisible: false);
            lst.Add("Liner 2 Name", "Liner2N", isVisible: false);
            lst.Add("Closer 3", "Closer3", isVisible: false);
            lst.Add("Closer 3 Name", "Closer3N", isVisible: false);
            lst.Add("Exit 2", "Exit2", isVisible: false);
            lst.Add("Exit 2 Name", "Exit2N", isVisible: false);

            return(lst);
        }
예제 #9
0
        /// <summary>
        /// Actualiza el datagrid de inhouse
        /// </summary>
        /// <param name="invitacion">Formulario de Incitación</param>
        /// <param name="module">En que modulo se esta invocando</param>
        /// <param name="dg">DataGrid Current</param>
        private void UpdateGridInvitation(Guest invitacion, EnumModule module, DataGrid dg)
        {
            var item          = dg.SelectedItem;
            var t             = item.GetType();
            var lstProperties = t.GetProperties().ToList();

            //***********************************************Disponible ***********************************************
            if (lstProperties.Any(c => c.Name == "guInvit"))
            {
                t.GetProperty("guInvit").SetValue(item, true);
            }

            //***********************************************Seguimiento***********************************************
            if (lstProperties.Any(c => c.Name == "guFollow"))
            {
                //Si estaba contactado y no como invitado
                if ((bool)t.GetProperty("guInfo").GetValue(item) &&
                    (bool)t.GetProperty("guInvit").GetValue(item) == false)
                {
                    //Con seguimiento
                    t.GetProperty("guFollow").SetValue(item, true);

                    //PR y Fecha de seguimiento
                    if (string.IsNullOrEmpty(t.GetProperty("guPRFollow").GetValue(item)?.ToString()))
                    {
                        t.GetProperty("guPRFollow").SetValue(item, invitacion.guPRInvit1);
                        t.GetProperty("guFollowD").SetValue(item, invitacion.guInvitD);
                    }
                }
            }
            //***********************************************Contactacion ***********************************************
            if (lstProperties.Any(c => c.Name == "guInfo"))
            {
                //Contactado
                t.GetProperty("guInfo").SetValue(item, true);

                //PR y fecha de contactacion
                if (string.IsNullOrEmpty(t.GetProperty("guPRInfo").GetValue(item)?.ToString()))
                {
                    t.GetProperty("guPRInfo").SetValue(item, invitacion.guPRInvit1);
                    t.GetProperty("guInfoD").SetValue(item, invitacion.guInvitD);
                }
            }

            //***********************************************Invitacion ***********************************************
            //Invitado
            t.GetProperty("guInvit").SetValue(item, true);

            //PR de Invitación
            if (lstProperties.Any(c => c.Name == "guPRInvit1"))
            {
                t.GetProperty("guPRInvit1").SetValue(item, invitacion.guPRInvit1);
            }

            //Invitacion no cancelada
            if (lstProperties.Any(c => c.Name == "guBookCanc"))
            {
                t.GetProperty("guBookCanc").SetValue(item, false);
            }

            //Fecha de no booking
            if (lstProperties.Any(c => c.Name == "guBookD"))
            {
                t.GetProperty("guBookD").SetValue(item, invitacion.guBookD);
            }

            //Hora de booking
            if (lstProperties.Any(c => c.Name == "guBookT"))
            {
                if (module != EnumModule.OutHouse)
                {
                    if (invitacion.guResch)
                    {
                        if (invitacion.guReschD == invitacion.guReschT)
                        {
                            t.GetProperty("guBookT").SetValue(item, invitacion.guReschT);
                        }
                    }
                    else
                    {
                        t.GetProperty("guBookT").SetValue(item, invitacion.guBookT);
                    }
                }
                else
                {
                    t.GetProperty("guBookT").SetValue(item, invitacion.guBookT);
                }
            }
            //Quiniela
            if (lstProperties.Any(c => c.Name == "guQuinella"))
            {
                t.GetProperty("guQuinella").SetValue(item, invitacion.guQuinella);
            }

            dg.Items.Refresh();
        }