Example #1
0
        /// <summary>
        /// Funcion para cerrar una sala de ventas segun el tipo requerido.
        /// </summary>
        /// <param name="_closeType"> Tipo de Cierre </param>
        /// <param name="_dateClose"> Date de cierre </param>
        /// <param name="_dateCloseLast">Date del ultimo cierre registrado </param>
        /// <history>
        /// [vipacheco] 01/03/2016 Created
        /// </history>
        private void CloseSalesRoom(EnumEntities _closeType, ref DateTimePicker _dateClose, DateTimePicker _dateCloseLast)
        {
            //verificacion de fechas no mayores a la actual
            if (_dateClose.Value.Value > _serverDate)
            {
                UIHelper.ShowMessage("Closing date con not be greater than today.", MessageBoxImage.Exclamation);
                return;
            }
            //Se pregunta si en verdad desea realizar el cierre
            if (UIHelper.ShowMessage("Are you sure you want to close all  " + _closeType.ToString() + " until " + _dateClose.Text + "? You wont't be able to modify that " + _closeType.ToString() + " anymore.",
                                     MessageBoxImage.Question) == MessageBoxResult.Cancel)
            {
                return;
            }

            //Realizamos el cierre
            BRSalesRooms.SetCloseSalesRoom(_closeType, Context.User.SalesRoom.srID, _dateClose.Value);

            //Guardamos la accion en el historico de sala de ventas
            BRSalesRoomsLogs.SaveSalesRoomLog(Context.User.SalesRoom.srID, Convert.ToInt16(Context.User.SalesRoom.srHoursDif), Context.User.User.peID);

            //Actualizamos datos de UI
            updateDate(_closeType, _dateClose.Value);
        }
Example #2
0
        /// <summary>
        /// FunciĆ³n para actualizar los controles DataPicker del UI
        /// </summary>
        /// <history>
        /// [vipacheco] 02/03/2016 Created
        /// </history>
        private void updateDate(EnumEntities salesRoomType, DateTime?dateUpdate)
        {
            switch (salesRoomType)
            {
            case EnumEntities.Shows:
                dtpCloseShows.Value     = _serverDate.AddDays(-1);
                dtpCloseShowsLast.Value = dateUpdate;
                break;

            case EnumEntities.MealTickets:
                dtpCloseMealTicket.Value      = _serverDate.AddDays(-1);
                dtpCloseMealTicketsLast.Value = dateUpdate;
                break;

            case EnumEntities.Sales:
                dtpCloseSales.Value     = _serverDate.AddDays(-1);
                dtpCloseSalesLast.Value = dateUpdate;
                break;

            case EnumEntities.GiftsReceipts:
                dtpCloseGiftsReceipts.Value     = _serverDate.AddDays(-1);
                dtpCloseGiftsReceiptsLast.Value = dateUpdate;
                break;
            }
            UIHelper.ShowMessage("Closing process completed.", MessageBoxImage.Information, salesRoomType.ToString() + " Process");
        }