/// <summary> /// Habilita / deshabilita los controles del formulario segun el modo de datos /// </summary> /// <param name="enumMode">Enumerado que indica si esta en modo de edicion o visual</param> /// <history> /// [jorcanche] created 11/08/2016 /// </history> private void SetMode(EnumMode enumMode) { var enable = enumMode != EnumMode.ReadOnly; //Controles del detalle txtguNoBookD.IsEnabled = cbmgunb.IsEnabled = cbmguPRNoBook.IsEnabled = enable; //Si se debe de habilitar if (enable) { //Fecha en que se definio el motivo de no booking if (string.IsNullOrEmpty(txtguNoBookD.Text)) { txtguNoBookD.Text = BRHelpers.GetServerDate().ToShortDateString(); _guest.guNoBookD = BRHelpers.GetServerDate(); } //PR que modifico el motivo de no booking cbmguPRNoBook.SelectedValue = _userData.User.peID; _guest.guPRNoBook = _userData.User.peID; //No se permite modificar la fecha ni el PR de no Booking txtguNoBookD.IsEnabled = false; cbmguPRNoBook.IsEnabled = false; } //Botones btnEdit.IsEnabled = !enable; btnCancel.IsEnabled = btnSave.IsEnabled = enable; }
/// <summary> /// Obtiene un reporte de Aviables en formato Excel /// </summary> /// <param name="aviables">Lista de Aviables</param> /// <history> /// [ecanul] 19/04/2016 Created /// [jorcanche] se agrego para abrir el archivo despues de guardar /// </history> public async static void AvailablesToExcel(List <RptAvailables> aviables, Window window) { filters = new List <Tuple <string, string> >(); dt = new DataTable(); filters.Add(Tuple.Create("Lead Source", Context.User.LeadSource.lsID)); DateTime date = BRHelpers.GetServerDate(); if (aviables.Count > 0) { dt = TableHelper.GetDataTableFromList(aviables, true); rptName = "Availables"; string dateRange = DateHelper.DateRangeFileName(date, date); ColumnFormatList format = new ColumnFormatList(); format.Add("GUID", "guID"); format.Add("Reserv.#", "guHReservID"); format.Add("Room", "guRoomNum"); format.Add("LastName", "guLastName1"); format.Add("Pax", "guPax", format: EnumFormatTypeExcel.DecimalNumber); format.Add("Check-In", "guCheckInD", format: EnumFormatTypeExcel.Date); format.Add("Check-Out", "guCheckOutD", format: EnumFormatTypeExcel.Date); format.Add("Country ID", "guco"); format.Add("Country", "coN"); format.Add("Agency ID", "guag"); format.Add("Agency", "agN"); format.Add("Av", "guAvail", format: EnumFormatTypeExcel.Boolean); format.Add("Info", "guInfo", format: EnumFormatTypeExcel.Boolean); format.Add("Inv", "guInvit", format: EnumFormatTypeExcel.Boolean); format.Add("PR B", "guPRInvit1"); format.Add("Comments", "guComments"); OpenFile(await ReportBuilder.CreateCustomExcelAsync(dt, filters, rptName, dateRange, format, addEnumeration: true), window); } }
/// <summary> /// Revisa si la contraseña esta proxima a expirar o si el usuario marco el checkBox changePassword /// </summary> /// <history> /// [erosado] 26/04/2016 Created /// </history> private int ChangePassword() { var value = 0; //Validamos la contraseña no haya expirado o el check este activo. var _expireDate = UserData.User.pePwdD.AddDays(UserData.User.pePwdDays); var _serverDate = BRHelpers.GetServerDate(); if (_serverDate > _expireDate || (bool)chkChangePwd.IsChecked) { var changePwd = new frmChangePassword(); changePwd.userLogin = UserData.User; changePwd.serverDate = _serverDate; changePwd.ShowDialog(); if (changePwd.blnOk) { UserData.User = changePwd.userLogin; } else { if (_serverDate > _expireDate) { UIHelper.ShowMessage("Password expired."); value = 1; } } } return(value); }
public async static Task <Rmmoney> ObtenerFactoresConversion(string strHotel) { return(await Task.Run(() => { Rmmoney canadianCurrency = null; HotelStringRequest request = new HotelStringRequest(); RmmoneyResponse response = new RmmoneyResponse(); // configuramos el request request.Hotel = strHotel; DateTime serverDate = BRHelpers.GetServerDate(); request.FechaInicial = serverDate; request.FechaFinal = serverDate; //invocamos al servicio web response = Current.ObtenerFactoresConversion(request);// ObtenerFactoresConversion if (response.HasErrors) { throw new Exception(response.ExceptionInfo.Message); } if (response.Data.Length > 0 && response.Data != null) { canadianCurrency = response.Data.SingleOrDefault(currency => currency.code == "DC"); } return canadianCurrency; })); }
private bool ValidateChangedByExist() { var pass = EncryptHelper.Encrypt(txtPassword.Password); var valid = BRHelpers.ValidateChangedByExist(txtUser.Text, pass, GuestParent.guls).FirstOrDefault();//BRGuests.ChangedByExist(txtUser.Text, pass, _user.LeadSource.lsID); if (string.IsNullOrWhiteSpace(valid?.Focus)) { return(true); } //desplegamos el mensaje de error UIHelper.ShowMessage(valid.Message); //establecemos el foco en el control que tiene el error switch (valid.Focus) { case "ID": case "ChangedBy": txtUser.Focus(); break; case "Password": txtPassword.Focus(); break; } return(false); }
private void btnEdit_Click(object sender, RoutedEventArgs e) { var log = new frmLogin(switchLoginUserMode: true); if (Context.User.AutoSign) { //Context.User.User.pePwd = EncryptHelper.Encrypt(Context.User.User.pePwd); log.UserData = Context.User; } log.ShowDialog(); if (log.IsAuthenticated) { if (log.UserData.HasPermission(EnumPermission.Register, EnumPermisionLevel.Standard)) { if (_guest.guFollow == false || (log.UserData.HasRole(EnumRole.PRCaptain) || log.UserData.HasRole(EnumRole.PRSupervisor))) { _user = log.UserData; txtguFollowD.Text = BRHelpers.GetServerDate().ToString("dd-MM-yyyy"); btnCancel.IsEnabled = btnSave.IsEnabled = cboguPRFollow.IsEnabled = true; btnEdit.IsEnabled = false; lblUserName.Content = log.UserData.User.peN; } else { UIHelper.ShowMessage("You do not have sufficient permissions to modify the follow up's information", MessageBoxImage.Asterisk, "Permissions"); } } else { UIHelper.ShowMessage("You do not have sufficient permissions to modify the follow up's information", MessageBoxImage.Asterisk, "Permissions"); } } }
/// <summary> /// Se agrego para implementar metodos async a la hora de consultar los datos del servidor /// </summary> /// <history> /// [erosado] 06/06/2016 Created, /// </history> private async void Window_Loaded(object sender, RoutedEventArgs e) { // desplegamos el nombre del servidor y de la base de datos var serverInformation = await BRHelpers.GetServerInformation(); lblServerName.Content = serverInformation[0]; lblDatabaseName.Content = serverInformation[1]; }
/// <summary> /// Permite guardar los datos extras de un registro /// </summary> /// <history> /// [jorcanche] created 07/04/2016 /// </history> public bool AfterValidate() { //Validamos la fecha y hora if (!ValidateHelper.ValidateRequired(txtpnDT, "date and time")) { return(false); } //validamos que la fecha no sea mayor a 7 días posteriores a su salida if (Convert.ToDateTime(txtpnDT.Text).Date > Convert.ToDateTime(txtguCheckOutD.Text).AddDays(7)) { UIHelper.ShowMessage("No notes are permitted after seven days after the departure."); return(false); } //Validamos quien hizo el cambio y su contraseña if (!ValidateHelper.ValidateChangedBy(txtpnPR, txtPwd, "PR")) { return(false); } //Validamos nota if (!ValidateHelper.ValidateRequired(txtpnText, "note")) { txtpnText.Focus(); return(false); } var validate = BRHelpers.ValidateChangedByExist(txtpnPR.Text, EncryptHelper.Encrypt(txtPwd.Password), Context.User.LeadSource.lsID, "PR").Single(); //Validamos que los datos de quien hizo el cambio y su contraseña existan if (validate.Focus != string.Empty) { //Desplegamos el mensaje de error UIHelper.ShowMessage(validate.Message); //Esteblecemos el foco en el control que tiene el error switch (validate.Focus) { case "ID": txtpnPR.Focus(); break; case "ChangedBy": txtpnPR.Focus(); break; case "Password": txtPwd.Focus(); break; case "PR": txtpnPR.Focus(); break; } return(false); } return(true); }
/// <summary> /// Valida que sea correcta la fecha proporcionada /// Sobrecarga del metodo que usa solo el DatePicker comun de wpf /// </summary> /// <param name="sender">Objeto de tipo DataTimePicker</param> /// <history> /// [ecanul] 28/07/2016 Created /// </history> public static void ValidateValueDate(DateTimePicker sender) { if (!sender.Value.HasValue) { //Cuando el usuario ingresa una fecha invalida UIHelper.ShowMessage("Invalid date", MessageBoxImage.Exclamation, "Specify the Date"); //Y le asignamos la fecha del servidor (la actual hora actual) sender.Value = BRHelpers.GetServerDate(); } }
///<summary>Obtiene el path de la aplicasión.</summary> ///<history> ///[michan] 14/04/2016 Created ///</history> public static string GetPath(string strLogName, DateTime?dtmDate = null) { if (dtmDate == null) { dtmDate = BRHelpers.GetServerDateTime(); } string path = AppContext.BaseDirectory.ToString(); string pathFile = Path.Combine(Path.Combine(Path.Combine(path, "Log"), $"Log{strLogName}({dtmDate.Value.ToString("yyyy")})"), $"Log{strLogName}({DateHelper.GetMonthName(dtmDate.Value.Month)})"); return(pathFile); }
/// <summary> /// Carga los datos iniciales /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// [ecanul] 15/03/2016 Created private void Window_Loaded(object sender, RoutedEventArgs e) { _isLoad = false; StaStart("Loading Data..."); _dtmServerDate = BRHelpers.GetServerDate(); dtpStartt.Value = _dtmServerDate; dtpEndd.Value = _dtmServerDate.AddDays(7); ChangeUseMode(false); //_isLoad = false; StaEnd(); }
/// <summary> /// Valida que la fecha de cierre no sea mayor a la fecha de hoy /// </summary> /// <returns></returns> /// <history> /// [vku] 11/Ago/2016 Created /// </history> protected bool ValidateCloseInvitationDate() { bool blnValid = true; if (dtpkCloseInvit.Value.Value > BRHelpers.GetServerDate()) { blnValid = false; UIHelper.ShowMessage("Close date can't be greater than today"); } return(blnValid); }
private void Window_Loaded(object sender, RoutedEventArgs e) { DateTime dateServer = BRHelpers.GetServerDate(); //fecha inicial dtpStart.SelectedDate = dateServer.AddDays(-7); //fecha final dtpEnd.SelectedDate = dateServer; //Indicamos el focus al txtname txtName.Focus(); }
/// <summary> /// Carga los huespedes /// </summary> /// <history> /// [aalcocer] 24/02/2016 Created /// </history> private void LoadGrid() { StaStart("Loading guests..."); _dtmServerdate = BRHelpers.GetServerDate(); _ltsGuestsMailOuts = BRGuests.GetGuestsMailOuts(Context.User.LeadSource.lsID, _dtmServerdate, _dtmServerdate.AddDays(1), _dtmServerdate.AddDays(2)); List <ObjGuestsMailOuts> _ltsObjGuestsMailOuts = _ltsGuestsMailOuts.Select(parent => new ObjGuestsMailOuts(parent)).ToList(); _objGuestsMailOutsViewSource.Source = _ltsObjGuestsMailOuts; dtgDatos.SelectedItem = null; StaEnd(); }
/// <summary> /// Valida que sea correcta la fecha proporcionada /// </summary> /// <param name="sender">Objeto de tipo DataPicker</param> /// <history>[jorcanche] 17/03/2016</history> public void ValidateValueDate(object sender) { //Obtener el valor actual del que tiene el dtpDate var picker = sender as DatePicker; if (!picker.SelectedDate.HasValue) { //Cuando el usuario ingresa una fecha invalida UIHelper.ShowMessage("Specify the Date"); //Y le asignamos la fecha del servidor (la actual hora actual) picker.SelectedDate = BRHelpers.GetServerDate(); } }
/// <summary> /// Agrega una nueva Nota /// </summary> /// <history> /// [jorcanche] created 07/04/2016 /// </history> private void btnAdd_Click(object sender, RoutedEventArgs e) { CleanControls(); if (Context.User.AutoSign) { txtpnPR.Text = Context.User.User.peID; cbopnPR.SelectedValue = Context.User.User.peID; txtPwd.Password = Context.User.User.pePwd; } EnabledControls(false, false, true); //ingresamos la fecha en el campo txtpnDT.Text = BRHelpers.GetServerDateTime().ToString("dd/MM/yyyy hh:mm:ss tt"); txtpnText.Focus(); _creatingNote = true; }
public frmCxCPayments(int iGiftReceiptID, decimal dcAmountToPay, decimal dcAmountPay, decimal balance) { InitializeComponent(); cxCPaymentShortViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("cxCPaymentShortViewSource"))); giftReceiptID = iGiftReceiptID; _dtpServerDate = BRHelpers.GetServerDate(); _lstExchangeRate = BRExchangeRate.GetExchangeRatesByDate(DateTime.Now, "MEX").FirstOrDefault(); dbExchange = (double)_lstExchangeRate.exExchRate; amountToPay = dcAmountToPay; amountPay = dcAmountPay; textBalance.Text = String.Format("{0:C}", balance); textTotal.Text = String.Format("{0:C}", dcAmountToPay); txtcxAmount.IsEnabled = txtcxAmountMXN.IsEnabled = imgButtonSave.IsEnabled = (dcAmountToPay == dcAmountPay || balance <= 0) ? false : true; }
/// <summary> /// Obtiene un reporte de Premanifest With Gifts en Formato de Excel /// </summary> /// <param name="premanifest">Listado con Premanifest With Gifts</param> /// <history> /// [ecanul] 19/04/2016 Created /// [jorcanche] se agrego para abrir el archivo despues de guardar /// </history> public static async void PremanifestWithGiftsToExcel(List <RptPremanifestWithGifts> withGifts, Window window) { filters = new List <Tuple <string, string> >(); dt = new DataTable(); filters.Add(Tuple.Create("Lead Source", Context.User.LeadSource.lsID)); DateTime date = BRHelpers.GetServerDate(); if (withGifts.Count > 0) { dt = TableHelper.GetDataTableFromList(withGifts, true); rptName = "Premanifest with gifts"; string dateRange = DateHelper.DateRangeFileName(date, date); OpenFile(await ReportBuilder.CreateCustomExcelAsync(dt, filters, rptName, dateRange, clsFormatReports.RptPremanifestWithGifts()), window); } }
int totalRows = 0; // total de registros #endregion #region Constructores y Destructores public frmCxCAuthorization() { InitializeComponent(); dtpkFrom.Value = dtmFrom; dtpkTo.Value = dtmTo; _dtpServerDate = BRHelpers.GetServerDate(); LoadCombo = new ExecuteCommandHelper(x => LoadPersonnel()); CxCDataViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("cxCDataViewSource"))); LoadAtributes(); underPaymentMotiveViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("underPaymentMotiveViewSource"))); if (!Context.User.HasPermission(EnumPermission.CxCAuthorization, EnumPermisionLevel.Standard)) { imgButtonSave.IsEnabled = false; dtgCxC.Columns.SingleOrDefault(c => c.Header.ToString() == "Auth.").IsReadOnly = true; } }
/// <summary> /// Configura los parametros de los reportes /// </summary> /// <history> /// [ecanul] 22/04/2016 Created /// [ecanul] 04/05/2016 Modificated, Corregido error con archivo de configuracion /// </history> private void SetupParameters() { _clsFilter = new ClsFilter(); DateTime serverDate = BRHelpers.GetServerDate(); // Fecha Inicial _clsFilter.DtmStart = new DateTime(serverDate.Year, serverDate.Month, 1); //Fecha final _clsFilter.DtmEnd = serverDate.Date; _allSalesRoom = false; // Obtenemos los valores de un archivo de configuracion SetUpIniField(); //roles de vendedores _clsFilter.LstEnumRole.AddRange(new[] { EnumRole.PR, EnumRole.Liner, EnumRole.Closer, EnumRole.ExitCloser }); }
/// <summary> /// Carga los datos de la ventana /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <history> /// [vku] 27/Jul/2016 Created /// </history> private void Window_Loaded(object sender, RoutedEventArgs e) { ObjectHelper.CopyProperties(season, oldSeason); _year = BRHelpers.GetServerDate(); lblYear.Content = _year.Year; LoadSeasonDates(); if (enumMode != EnumMode.ReadOnly) { btnAccept.Visibility = Visibility.Visible; txtssID.IsEnabled = (enumMode == EnumMode.Add); txtDescrip.IsEnabled = true; txtClosFac.IsEnabled = true; chkActive.IsEnabled = true; UIHelper.SetUpControls(season, this); } DataContext = season; skpStatus.Visibility = Visibility.Collapsed; }
/// <summary> /// Carga la informacion del formulario /// </summary> /// <history> /// [aalcocer] 05/03/2016 Created /// </history> private async void Window_ContentRendered(object sender, EventArgs e) { DateTime serverDate = BRHelpers.GetServerDate(); // Fecha inicial dtpStartDate.Value = new DateTime(serverDate.Year, serverDate.Month, 1); //Fecha final dtpEndDate.Value = serverDate; LoadFromFile(); // Lead Source cmbLS.ItemsSource = await BRLeadSources.GetLeadSources(1, Model.Enums.EnumProgram.All); cmbLS.SelectedValue = _leadsource.lsID; // Realiza la gráfica DoGraph(Convert.ToDateTime(dtpStartDate.Value), Convert.ToDateTime(dtpEndDate.Value), cmbLS.SelectedValue.ToString()); }
/// <summary> /// Trae las noticias y las carga en el rtb /// </summary> /// <history> /// [jorcanche] 19/04/2016 /// </history> private async void GetNotices() { rtbViewerNotice.Document.Blocks.Clear(); RTFNotices = string.Empty; RTFNotice = string.Empty; var notices = await BRNotices.GetNotices(Context.User.LeadSource.lsID, BRHelpers.GetServerDate()); if (notices.Count > 0) { foreach (var notice in notices) { RTFNotices = RTFNotices + Title(notice.noTitle); RTFNotices = RTFNotices + Text(notice.noText); } UIRichTextBoxHelper.LoadRTF(ref rtbViewerNotice, RTFNotices); RTFNotice = UIRichTextBoxHelper.getRTFFromRichTextBox(ref rtbViewerNotice); } }
/// <summary> /// Inicio y configuracion del formulario. /// </summary> /// <history> /// [edgrodriguez] 18/Feb/2016 Created /// </history> private void frmInventoryMovements_Loaded(object sender, RoutedEventArgs e) { _salesRoom = BRSalesRooms.GetSalesRoom(Context.User.Warehouse.whID); KeyboardHelper.CkeckKeysPress(StatusBarCap, Key.Capital); KeyboardHelper.CkeckKeysPress(StatusBarIns, Key.Insert); KeyboardHelper.CkeckKeysPress(StatusBarNum, Key.NumLock); lblUserName.Content = Context.User.User.peN; lblWareHouse.Content = Context.User.Warehouse.whN; lblCloseDate.Content = "Close Receipts Date: " + _salesRoom.srGiftsRcptCloseD.ToString("dd/MMM/yyyy"); InitializeGrdNew(); _dtmServerdate = BRHelpers.GetServerDate(); dtpDate_SelectedDateChanged(null, null); GridHelper.SetUpGrid(grdNew, new WarehouseMovement()); if (((EnumPermisionLevel)Context.User.Permissions.FirstOrDefault(c => c.pppm == "GIFTSRCPTS")?.pppl) >= EnumPermisionLevel.Special) { fraDate.IsEnabled = true; } }
/// <summary> ///Prepara el reporte de invitación para ser visualizado /// </summary> /// <history> /// [jorcanche] 16/04/2016 created /// [jorcanche] 12/05/2016 Se cambio de frmInvitaciona RptinvitationHelper /// </history> public static async void RptInvitation(int guest = 0, string peID = "USER", Window window = null) { //Traemos la informacion del store y la almacenamos en un procedimiento InvitationData invitationData = await BRInvitation.RptInvitationData(guest); //Le damos memoria al reporte de Invitacion var rptInvi = new rptInvitation(); /************************************************************************************************************ * Información Adiocional sobre el DataSource del Crystal ************************************************************************************************************* * Para que el DataSource acepte una entidad primero se debe de converir a lista * 1.- ObjectHelper.ObjectToList(invitationData.Invitation) * Pero sí al convertirlo hay propiedades nulas, el DataSource no lo aceptara y marcara error; para evitar esto * se debera convertir a DateTable para que no tenga nulos. * 2.- TableHelper.GetDataTableFromList(ObjectHelper.ObjectToList(invitationData.Invitation)) *************************************************************************************************************/ //Le agregamos la informacion rptInvi.SetDataSource(TableHelper.GetDataTableFromList(ObjectHelper.ObjectToList(new IM.Base.Classes.RptInvitationIM(invitationData.Invitation)))); //Cargamos los subreportes rptInvi.Subreports["rptInvitationGuests.rpt"].SetDataSource(TableHelper.GetDataTableFromList(invitationData.InvitationGuest?.Select(c => new IM.Base.Classes.RptInvitationGuestsIM(c)).ToList() ?? new List <Classes.RptInvitationGuestsIM>())); rptInvi.Subreports["rptInvitationDeposits.rpt"].SetDataSource(invitationData.InvitationDeposit?.Select(c => new IM.Base.Classes.RptInvitationDepositsIM(c)).ToList() ?? new List <Classes.RptInvitationDepositsIM>()); rptInvi.Subreports["rptInvitationGifts.rpt"].SetDataSource(TableHelper.GetDataTableFromList(invitationData.InvitationGift?.Select(c => new IM.Base.Classes.RptInvitationGiftsIM(c)).ToList() ?? new List <Classes.RptInvitationGiftsIM>())); //Cambiamos el lenguaje de las etiquetas. CrystalReportHelper.SetLanguage(rptInvi, invitationData.Invitation.gula); //Fecha y hora rptInvi.SetParameterValue("lblDateTime", BRHelpers.GetServerDateTime()); //Cambiado por rptInvi.SetParameterValue("lblChangedBy", peID); //Cargamos el Viewer var frmViewer = new frmViewer(rptInvi) { Owner = window }; frmViewer.ShowDialog(); }
/// <summary> /// Carga los valores iniciales del formulario /// </summary> /// <history> /// [vipacheco] 17/Agosto/2016 Created /// </history> private async void Window_Loaded(object sender, RoutedEventArgs e) { // Cargamos el combo de LeadSource cboLeadSourse.ItemsSource = await BRLeadSources.GetLeadSourcesByUser(_user.User.peID, EnumProgram.Inhouse); cboLeadSourse.SelectedValue = _user.LeadSource != null ? _user.LeadSource.lsID : _user.SalesRoom.srID; cboLeadSourse.IsEnabled = (_leadSourceID == ""); DateTime dateServer = BRHelpers.GetServerDate(); // Fecha Inicial dtpStart.Value = dateServer.AddDays(-7); // Fecha Final dtpEnd.Value = dateServer; // Verificamos que Bloq Key estan activos CkeckKeysPress(StatusBarCap, Key.Capital); CkeckKeysPress(StatusBarIns, Key.Insert); CkeckKeysPress(StatusBarNum, Key.NumLock); }
/// <summary> /// Agrega una promocion /// </summary> /// <param name="Promotions"></param> /// <param name="Hotel"></param> /// <param name="Folio"></param> /// <param name="Promotion"></param> /// <param name="GiftID"></param> /// <param name="ReceiptID"></param> /// <param name="User"></param> /// <param name="enumPromotionsSystem"></param> /// <history> /// [vipacheco] 27/Mayo/2016 Created /// [vipacheco] 23/Agosto/2016 Modified -> se cambio el tipo del parametro Promotions /// </history> public static void AddPromotion(ref List <GuardaPromocionForzadaRequest> Promotions, string Hotel, string Folio, string Promotion, string GiftID, int ReceiptID, string User, EnumPromotionsSystem enumPromotionsSystem) { GuardaPromocionForzadaRequest request = new GuardaPromocionForzadaRequest() { hotel = Hotel, folio = Folio, adicional = (enumPromotionsSystem == EnumPromotionsSystem.PVP) ? "1" : "0", idpromo = Promotion, GiftID = GiftID, GiftsReceiptID = $"{ReceiptID}", usralta = User, fechaalta = BRHelpers.GetServerDate(), idtipoasignacion = "CONT", status = "A", tipomov = "", usrmodif = "" }; Promotions.Add(request); }
/// <summary> /// Agrega un cargo a habitacion /// </summary> /// <param name="RoomCharges"></param> /// <param name="Hotel"></param> /// <param name="Folio"></param> /// <param name="User"></param> /// <param name="Receipt"></param> /// <param name="Gift"></param> /// <param name="Amount"></param> /// <param name="TransactionType"></param> /// <history> /// [vipacheco] 01/Junio/2016 Created /// </history> public static void AddRoomCharge(ref List <CargoHabitacionRequest> RoomCharges, string Hotel, int Folio, string User, int Receipt, string Gift, decimal Amount, string TransactionType) { CargoHabitacionRequest newItem = new CargoHabitacionRequest() { Hotel = Hotel, Folio = Folio, Type = TransactionType, Cashier = User, Ent_oper = User, Note = "Gifts Receipt " + Receipt + ". Gift '" + Gift + "'. Room charge from Origos.", Currency = "USD", Auth = "0", Loc = "Origos", Inv_chk = "0", Bill_to = "F", PostDate = BRHelpers.GetServerDate(), Entry_amt = Amount }; RoomCharges.Add(newItem); }
/// <summary> /// Obtiene los regalos de cargos a habitacion /// </summary> /// <param name="ReceiptID"></param> /// <param name="aGifts"></param> /// <param name="Request"></param> /// <param name="ChargeTo"></param> /// <returns></returns> /// <history> /// [vipacheco] 01/Junio/2016 Created /// </history> public static List <CargoHabitacionRequest> GetGiftsRoomCharges(int ReceiptID, ref List <GiftType> aGifts, ref CargoHabitacionTRNRequest Request, string ChargeTo) { List <CargoHabitacionRequest> aRoomCharges = new List <CargoHabitacionRequest>(); // obtenemos los cargos a habitacion de Opera que no se han dado List <GiftsReceiptDetailRoomChargesOpera> lstResult = BRGiftsReceiptDetail.GetGiftsReceiptDetailRoomChargesOpera(ReceiptID); if (lstResult.Count > 0) { GiftsReceiptDetailRoomChargesOpera First = lstResult[0]; // Configuramos el Request Request.Hotel = First.gulsOriginal; Request.Folio = Convert.ToInt32(First.guHReservID); Request.PostDate = BRHelpers.GetServerDate(); Request.Batch = First.rhConsecutive != null ? $"{First.rhConsecutive}" : ""; foreach (GiftsReceiptDetailRoomChargesOpera Current in lstResult) { // agregamos el cargo a habitacion AddRoomCharge(ref aRoomCharges, Current.gulsOriginal, Convert.ToInt32(Current.guHReservID), ChargeTo, ReceiptID, Current.giN, Current.gePriceA, Current.giOperaTransactionType); // preparamos los regalos con cargos a habitacion que se guardaran en Origos GiftType _Gift = new GiftType(); _Gift.ID = Current.gegi; _Gift.Descripcion = Current.giN; _Gift.Quantity = 0; _Gift.Receipt = ReceiptID; _Gift.Promotion = ""; _Gift.TransactionTypeOpera = Current.giOperaTransactionType; // Agregamos a la lista aGifts.Add(_Gift); } Request.CargosHabitacion = aRoomCharges.ToArray(); } return(aRoomCharges); }
/// <summary> /// Valida los datos para desplegar el formulario de contactacion /// </summary> /// <param name="checkIn">Si ya hizo CheckIn</param> /// <param name="contact"> Si ya esta contactado</param> /// <param name="checkOutD">Fecha de contactación</param> /// <returns></returns> ///<history>[jorcanche] 13/03/2016</history> private bool ValidateContact(bool checkIn, bool contact, DateTime checkOutD) { //validamos que el huesped haya hecho Check In if (!checkIn) { UIHelper.ShowMessage("Guest has not made Check-in.", MessageBoxImage.Asterisk); return(false); } // no se permite contactar si ya hizo Check Out o si ya esta contactado el Guest if (!contact && checkOutD < BRHelpers.GetServerDate()) { UIHelper.ShowMessage("Guest already made Check-out.", MessageBoxImage.Asterisk); return(false); } //validamos que el usuario tenga permiso de lectura if (!Context.User.HasPermission(EnumPermission.Register, EnumPermisionLevel.ReadOnly)) { UIHelper.ShowMessage("Access denied.", MessageBoxImage.Asterisk); return(false); } return(true); }