/// <summary> /// Despliega el formulario de invitacion /// </summary> /// <param name="guCheckIn">Check In del Huesped</param> /// <param name="guId">Id del Guest</param> /// <param name="isInvit">Si ya se invito el guest</param> /// <history> /// [jorcanche] 16/ago/2016 Created /// </history> private async void ShowInvitation(bool guCheckIn, int guId, bool isInvit) { if (ValidateInvitation(guCheckIn)) { frmLogin login = new frmLogin(loginType: EnumLoginType.Location, program: EnumProgram.Outhouse, validatePermission: true, permission: EnumPermission.PRInvitations, permissionLevel: EnumPermisionLevel.Standard, switchLoginUserMode: true, invitationMode: true, invitationPlaceId: Context.User.Location.loID); if (!isInvit) { if (Context.User.AutoSign) { login.UserData = Context.User; } await login.getAllPlaces(); login.ShowDialog(); if (!login.IsAuthenticated) { return; } } else if (Context.User.HasPermission(EnumPermission.PRInvitations, EnumPermisionLevel.Standard) && !Context.User.AutoSign) { login = new frmLogin(loginType: EnumLoginType.Location, program: EnumProgram.Outhouse, validatePermission: true, permission: EnumPermission.PRInvitations, permissionLevel: EnumPermisionLevel.ReadOnly, switchLoginUserMode: true, invitationMode: true, invitationPlaceId: Context.User.Location.loID); await login.getAllPlaces(); login.ShowDialog(); if (!login.IsAuthenticated) { return; } } else { login.UserData = Context.User; } if (isInvit || login.IsAuthenticated) { var invitacion = new frmInvitation (EnumModule.OutHouse, EnumInvitationType.existing, login != null ? login.UserData : Context.User, guId) { Owner = this }; invitacion.ShowDialog(); if (invitacion.SaveGuestInvitation) { //actualizamos los datos del grid UpdateGridInvitation(invitacion.dbContext.Guest, invitacion._module, dgGuestPremanifest); } } } }
/// <summary> /// Abre el formulario de invitación para agrear una nueva /// </summary> /// <history> /// [jorcanche] created 05/05/2016 /// </history> private async void btnNewInv_Click(object sender, RoutedEventArgs e) { var login = new frmLogin(loginType: EnumLoginType.Location, program: EnumProgram.Outhouse, validatePermission: true, permission: EnumPermission.PRInvitations, permissionLevel: EnumPermisionLevel.Standard, switchLoginUserMode: true, invitationMode: true, invitationPlaceId: Context.User.Location.loID); if (Context.User.AutoSign) { login.UserData = Context.User; } await login.getAllPlaces(); login.ShowDialog(); if (login.IsAuthenticated) { var invitacion = new frmInvitation(EnumModule.OutHouse, EnumInvitationType.newOutHouse, login.UserData) { Owner = this }; invitacion.ShowDialog(); } }