コード例 #1
0
 public FormworkDetailViewModel()
 {
     _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();
     //订阅
     _eventAggregator.GetEvent<CmdEvent>().Subscribe(param =>
     {
         CurrentFormwork = param.Entity as FormWork;
         IdKeyWordsTmp = new IDKeyWordsEx();
         if (CurrentFormwork == null)
         {
             CurrentFormwork = new FormWork();
             IsProModelEnb = true;
         }
         else
         {
             IsProModelEnb = false;
             IdKeyWordsTmp.Assignment(CurrentFormwork.IDKeyWords, CurrentFormwork.IDNumber);
         }
     }, ThreadOption.UIThread, true, p => p.Target == "FormworkDetailViewModel");
     _rule = new FormworkRule();
     _rule.PropertyChanged += (s, e) =>
         {
             if (e.PropertyName.Equals("IsBusy"))
             {
                 this.IsBusy = _rule.IsBusy;
             }
         };
     _rule.AddFormworkCompleted += (s, e) =>
        {
            if (e.Cancelled)
            {
                Common.MessageBox.Show(e.Error.Message);
            }
            else
            {
                Common.MessageBox.Show("添加成功");
                _eventAggregator.GetEvent<CmdEvent>().Publish(new CmdEventParam()
                {
                    cmdViewName = CmdViewName.FormworkMainView,
                    Target = "Sell",
                });
            }
        };
     _rule.ModifyFormworkCompleted += (s, e) =>
         {
             if (e.Cancelled)
             {
                 Common.MessageBox.Show(e.Error.Message);
             }
             else
             {
                 Common.MessageBox.Show("修改成功");
                 _eventAggregator.GetEvent<CmdEvent>().Publish(new CmdEventParam()
                 {
                     cmdViewName = CmdViewName.FormworkMainView,
                     Target = "Sell",
                 });
             }
         };
 }
コード例 #2
0
ファイル: FormworkRule.cs プロジェクト: shew990/github
 public void AddFormworkAsyns(FormWork entity)
 {
     string ErrMsg = string.Empty;
     Proxy.BeginAddFormWork(CurrentAccount.CheckCode, CurrentAccount.ID, entity, ref ErrMsg, result =>
     {
         ThreadHelper.BeginInvokeOnUIThread(() =>
         {
             try
             {
                 bool bResult = Proxy.EndAddFormWork(ref ErrMsg, result);
                 if (bResult)
                 {
                     AddFormworkCompleted(this, new ResultArgs<bool>(bResult, null, false, result.AsyncState));
                 }
                 else
                 {
                     AddFormworkCompleted(this, new ResultArgs<bool>(bResult, new Exception(ErrMsg), true, result.AsyncState));
                 }
             }
             catch (Exception ex)
             {
                 if (AddFormworkCompleted != null)
                 {
                     AddFormworkCompleted(this, new ResultArgs<bool>(false, ex, true, result.AsyncState));
                 }
             }
         });
     }, null);
 }
コード例 #3
0
 public IAsyncResult BeginModifyFormWork(string checkCode, int AccountID, FormWork entity, ref string ErrMsg, AsyncCallback callback, object asyncState)
 {
     IncrementCallCount();
     var pCallback = new AsyncCallback((ar) =>
     {
         DecrementCallCount();
         callback(ar);
     });
     return _client.BeginModifyFormWork(checkCode, AccountID, entity, ref ErrMsg, pCallback, asyncState);
 }
コード例 #4
0
 private void buttonLogIn_Click(object sender, EventArgs e)
 {
     if (textBoxLogin.Text != String.Empty && textBoxPassword.Text != String.Empty && comboBoxPointWork.SelectedIndex != -1)
     {
         User u = LogIn(textBoxLogin.Text, textBoxPassword.Text);
         if (u != null)
         {
             FormWork fw = new FormWork(u, this);
             textBoxLogin.Text               = "";
             textBoxPassword.Text            = "";
             comboBoxPointWork.SelectedIndex = -1;
             this.Hide();
             fw.Show();
         }
         else
         {
             MessageBox.Show("Не удалось выполнить вход. Проверьте правильность введенных данных.");
         }
     }
     else
     {
         MessageBox.Show("Не введены какие-то данные.");
     }
 }
コード例 #5
0
 public bool DelFormWork(string checkCode, int AccountID, FormWork entity, ref string ErrMsg)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
 public StockLotOut GetStockLotOutEntityByLotNo_Out_NO(string checkCode, int AccountID, string LotNo, int Qty, string ProModel, ref FormWork formWork, ref int OutCount, ref string ErrMsg)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public StockLotOut EndGetStockLotOutEntityByLotNo_Out_NO(ref FormWork formWork, ref int OutCount, ref string ErrMsg, IAsyncResult result)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public IAsyncResult BeginGetStockLotOutEntityByLotNo_Out_NO(string checkCode, int AccountID, string LotNo, int Qty, string ProModel, ref FormWork formWork, ref int OutCount, ref string ErrMsg, AsyncCallback callback, object asyncState)
 {
     throw new NotImplementedException();
 }