예제 #1
0
        private async void btnSave_Click(object sender, RoutedEventArgs e)
        {
            Mouse.OverrideCursor = Cursors.Wait;
            try
            {
                if (Validate())
                {
                    //guardamos la informacion del seguimiento
                    _guest.guPRFollow = cboguPRFollow.SelectedValue.ToString();
                    _guest.guFollowD  = Convert.ToDateTime(txtguFollowD.Text).Date;
                    _guest.guFollow   = true;

                    //Enviamos los parametros para que guarde los cambios del guest y el log del Guest.
                    //Si hubo un erro al ejecutar el metodo SaveGuestAvailOrFollowUp nos devolvera 0, indicando que ningun paso
                    //se realizo, es decir ni se guardo el Guest ni el Log, y siendo así ya no modificamos la variable
                    //_wasSaved que es la que indica que se guardo el FollowUp.
                    if (await BRGuests.SaveChangedOfGuest(_guest, Context.User.LeadSource.lsHoursDif, _user.User.peID) != 0)
                    {
                        _wasSaved             = true;
                        chkguFollow.IsChecked = true;
                    }
                    else
                    {
                        UIHelper.ShowMessage("There was an error saving the information, consult your system administrator",
                                             MessageBoxImage.Error, "Information can not keep");
                    }
                    Close();
                }
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
            Mouse.OverrideCursor = null;
        }
예제 #2
0
        private async void btnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Validate())
                {
                    //guardamos la informacion de disponibilidad
                    _guest.guum          = txtguum.Text != string.Empty ? Convert.ToByte(txtguum.Text) : (byte)0;
                    _guest.guOriginAvail = chkguOriginAvail.IsChecked.Value;
                    _guest.guAvail       = chkguAvail.IsChecked.Value;
                    _guest.guPRAvail     = cboguPRAvail.SelectedValue == null ? _user.User.peID : cboguPRAvail.SelectedValue.ToString();

                    //Enviamos los parametros para que guarde los cambios del guest y el log del Guest.
                    //Si hubo un erro al ejecutar el metodo SaveChangedOfGuest nos devolvera 0, indicando que ningun paso
                    //se realizo, es decir ni se guardo el Guest ni el Log, y siendo así ya no modificamos la variable
                    //_wasSaved que es el que indica que se guardo el Avail.
                    if (await BRGuests.SaveChangedOfGuest(_guest, Context.User.LeadSource.lsHoursDif, _user.User.peID) != 0)
                    {
                        WasSaved = true;
                    }
                    else
                    {
                        //De no ser así informamos que no se guardo la información por algun motivo
                        UIHelper.ShowMessage("There was an error saving the information, consult your system administrator",
                                             MessageBoxImage.Error, "Information can not keep");
                    }
                    Close();
                }
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
예제 #3
0
        /// <summary>
        /// Guarda los cambios
        /// </summary>
        /// <history>
        /// [jorcanche] 30/03/2016 created
        /// </history>
        private async void ValidateSave()
        {
            try
            {
                //Invertimos el valor del Check si cancelo o lo descancelo
                Cancelado = chkguBookCanc.IsChecked = chkguBookCanc.IsChecked != null && !chkguBookCanc.IsChecked.Value;
                //Guardamos el BookCanceled
                _guest.guBookCanc = Cancelado.Value;

                //Enviamos los parametros para que guarde los cambios del guest y el log del Guest.
                //Si hubo un erro al ejecutar el metodo SaveChangedOfGuest nos devolvera 0, indicando que ningun paso
                //se realizo, es decir ni se guardo el Guest ni el Log, y siendo así ya no modificamos la variable
                //_wasSaved que es el que indica que se guardo el Avail.
                if (await BRGuests.SaveChangedOfGuest(_guest, Context.User.LeadSource.lsHoursDif, _user.peID) == 0)
                {
                    //De no ser así informamos que no se guardo la información por algun motivo
                    UIHelper.ShowMessage("There was an error saving the information, consult your system administrator",
                                         MessageBoxImage.Error, "Information can not keep");
                    //Regresamos el Valor a como estaba
                    Cancelado = chkguBookCanc.IsChecked = !chkguBookCanc.IsChecked.Value;
                }
                Close();
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }
예제 #4
0
        /// <summary>
        /// Abre el formulario que funciona para buscar un Guest y lo transfiere al OutHouse que esta actual
        /// </summary>
        /// <history>
        /// [jorcanche] created 05/05/2016
        /// [vipacheco] 04/Agosto/2016 Modified -> Se agrego el parametro EnumProgram al frmSearchGuest
        /// </history>
        private async void btnTransfer_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var frmsearchGuest = new frmSearchGuest(Context.User, EnumProgram.Outhouse)
                {
                    Owner         = this,
                    ShowInTaskbar = false
                };
                //Si ya se cerro la ventana
                //Valida que haya sido un OK y no un Cancel
                frmsearchGuest.ShowDialog();
                if (!frmsearchGuest.cancel)
                {
                    var guest = frmsearchGuest.lstGuestAdd[0];
                    guest.guls         = Context.User.LeadSource.lsID;
                    guest.guBookCanc   = false;
                    guest.guloInvit    = Context.User.LeadSource.lsID;
                    guest.gulsOriginal = Context.User.LeadSource.lsID;

                    //Enviamos los parametros para que guarde los cambios del guest y el log del Guest.
                    //Si hubo un error al ejecutar el metodo SaveChangedOfGuest nos devolvera 0, indicando que ningun paso
                    //se realizo, es decir ni se guardo el Guest ni el Log
                    if (await BRGuests.SaveChangedOfGuest(guest, Context.User.LeadSource.lsHoursDif, Context.User.User.peID) == 0)
                    {
                        //De no ser así informamos que no se guardo la información por algun motivo
                        UIHelper.ShowMessage("There was an error saving the information, consult your system administrator",
                                             MessageBoxImage.Error, "Information can not keep");
                    }
                }
            }
            catch (Exception ex)
            {
                UIHelper.ShowMessage(ex);
            }
        }