Esempio n. 1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (oldEndDate == VM.EndDate)
            {
                CPApplication.Current.CurrentPage.Context.Window.Alert(ResGiftCardInfo.Information_NoValueForUpdate, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Warning);
            }
            else
            {
                CPApplication.Current.CurrentPage.Context.Window.Confirm(ResGiftCardInfo.Information_NeedForUpdateAgain, (obj, args) =>
                {
                    if (args.DialogResult == DialogResultType.OK)
                    {
                        GiftCardInfo item = VM.ConvertVM <GiftCardVM, GiftCardInfo>();
                        item.Customer     = customerInfo;
                        facade.UpdateGiftCardInfo(item, (obj2, args2) =>
                        {
                            if (args2.FaultsHandle())
                            {
                                return;
                            }

                            CPApplication.Current.CurrentPage.Context.Window.Alert(ResGiftCardInfo.Information_OperateSuccessful, Newegg.Oversea.Silverlight.Controls.Components.MessageType.Information);

                            CloseDialog(DialogResultType.OK);
                        });
                    }
                });
            }
        }