Example #1
0
        private void btnHold_Click(object sender, RoutedEventArgs e)
        {
            Button btn    = sender as Button;
            string reason = null;

            switch (btn.CommandParameter.ToString())
            {
            case "Hold":
                reason = string.Format(ResSO.Content_SO_Hold, txtHoldReason.Text, CPApplication.Current.LoginUser.LoginName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                break;

            case "UnHold":
                reason = string.Format(ResSO.Content_SO_UnHold, txtHoldReason.Text, CPApplication.Current.LoginUser.LoginName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                break;
            }

            if (CurrentSOVM.BaseInfoVM.HoldStatus.Value == BizEntity.SO.SOHoldStatus.BackHold || CurrentSOVM.BaseInfoVM.HoldStatus.Value == BizEntity.SO.SOHoldStatus.WebHold)
            {
                SOFacade.UnholdSO(CurrentSOVM.SysNo.Value, reason, (vm) =>
                {
                    CurrentSOVM = vm;
                    Window.Alert(ResSO.Info_SO_Processer_ChangePrice_UnHoldSO, MessageType.Information);
                    Dialog.Close();
                });
            }
            else
            {
                SOFacade.HoldSO(CurrentSOVM.SysNo.Value, reason, (vm) =>
                {
                    CurrentSOVM = vm;
                    Window.Alert(ResSO.Info_SO_Processer_ChangePrice_HoldSO, MessageType.Information);
                    Dialog.Close();
                });
            }
        }