Beispiel #1
0
        /// <summary>
        /// Función encargada de verificar si cuenta con los permisos de edicion!
        /// </summary>
        /// <history>
        /// [vipacheco] 23/04/2016 Created
        /// </history>
        private void Cell_DoubleClick(object sender, RoutedEventArgs e)
        {
            // Se verifica que tenga permisos de editar
            if (_modeOpen != EnumMode.ReadOnly)
            {
                MealTicket mealTicket = grdMealTicket.SelectedItem as MealTicket;

                frmMealTicketsDetail frmealTkt = new frmMealTicketsDetail(_openBy)
                {
                    Owner = this
                };
                ObjectHelper.CopyProperties(frmealTkt._mealTicketCurrency, mealTicket);
                frmealTkt._modeOpen = EnumMode.Edit;
                frmealTkt.Title    += "Edit - ID " + mealTicket.meID;

                if (frmealTkt.ShowDialog().Value)
                {
                    int        indexOrigin = obsMealTicket.IndexOf(mealTicket);
                    MealTicket _mealTicket = ObjectHelper.CopyProperties(frmealTkt._mealTicketCurrency);

                    if (_modeOpen == EnumMode.Edit && _openBy == EnumOpenBy.Checkbox)
                    {
                        dsMealTicket.Source = BRMealTickets.GetMealTickets(_guestID);
                    }
                    else if (_modeOpen == EnumMode.Edit && _openBy == EnumOpenBy.Button)
                    {
                        obsMealTicket.Insert(indexOrigin, _mealTicket); obsMealTicket.Remove(mealTicket);
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Función para agregar un nuevo Meal Ticket
        /// </summary>
        /// <history>
        /// [vipacheco] 22/03/2016 Created
        /// </history>
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            frmMealTicketsDetail mealTicketsDetail = new frmMealTicketsDetail(_openBy)
            {
                Owner = this
            };

            mealTicketsDetail._modeOpen = EnumMode.Add;
            mealTicketsDetail.Title    += "Add";

            if (mealTicketsDetail.ShowDialog().Value)
            {
                if (_modeOpen == EnumMode.Edit && _openBy == EnumOpenBy.Checkbox)
                {
                    dsMealTicket.Source = BRMealTickets.GetMealTickets(_guestID);
                }
                else if (_modeOpen == EnumMode.Edit && _openBy == EnumOpenBy.Button)
                {
                    obsMealTicket.Add(mealTicketsDetail._mealTicketCurrency);
                }
            }
        }