コード例 #1
0
ファイル: UIEstimate.xaml.cs プロジェクト: sajidk/Estimate-SL
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void db_UpdateEstimateCompleted(object sender, UpdateEstimateCompletedEventArgs e)
 {
     Result result = null;
     if (e.Error == null)
     {
         result = e.Result;
         if (result.Msg == "成功")
         {
             Windows.CWEPrompt prompt = new Windows.CWEPrompt(result.No);
             prompt.Show();
             prompt.OKButtonClicked += new EventHandler(SetFormClear);
         }
         else
         {
             MessageBox.Show(result.Msg);
         }
     }
     else
     {
         MessageBox.Show(e.Error.Message);
     }
 }
コード例 #2
0
ファイル: UIEstimate.xaml.cs プロジェクト: sajidk/Estimate-SL
 private void ContextMenuItem_Click(object sender, RoutedEventArgs e)
 {
     switch((sender as MenuItem).Name)
     {
         case "mnuCopy":
             edtail = dgEstimate.SelectedItem as EDetails;
             break;
         case "mnuClear":
             if (dgEstimate.SelectedItem == null) return;
             ((TextBlock)dgEstimate.Columns[0].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             ((TextBlock)dgEstimate.Columns[1].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             ((TextBlock)dgEstimate.Columns[2].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             ((TextBlock)dgEstimate.Columns[3].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             ((TextBlock)dgEstimate.Columns[4].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             ((TextBlock)dgEstimate.Columns[5].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             ((TextBlock)dgEstimate.Columns[6].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             ((TextBlock)dgEstimate.Columns[7].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             ((TextBlock)dgEstimate.Columns[8].GetCellContent(dgEstimate.SelectedItem)).Text = string.Empty;
             (dgEstimate.SelectedItem as EDetails).Product = string.Empty;
             (dgEstimate.SelectedItem as EDetails).Amount = 0;
             (dgEstimate.SelectedItem as EDetails).Quantity= 0;
             hasError = false;
             CalculateAmt();
             break;
         case "mnuPaste":
             if (edtail == null) return;
             if (dgEstimate.SelectedItem == null) return;
             ((TextBlock)dgEstimate.Columns[0].GetCellContent(dgEstimate.SelectedItem)).Text = edtail.Product;
             (dgEstimate.SelectedItem as EDetails).Product = edtail.Product;
             ((TextBlock)dgEstimate.Columns[1].GetCellContent(dgEstimate.SelectedItem)).Text = edtail.PTypeName;
             (dgEstimate.SelectedItem as EDetails).PTypeName = edtail.PTypeName;
             ((TextBlock)dgEstimate.Columns[2].GetCellContent(dgEstimate.SelectedItem)).Text = edtail.Quantity.ToString();
             (dgEstimate.SelectedItem as EDetails).Quantity = edtail.Quantity;
             ((TextBlock)dgEstimate.Columns[3].GetCellContent(dgEstimate.SelectedItem)).Text = edtail.UnitName;
             (dgEstimate.SelectedItem as EDetails).UnitName = edtail.UnitName;
             ((TextBlock)dgEstimate.Columns[4].GetCellContent(dgEstimate.SelectedItem)).Text = edtail.UCost.ToString();
             (dgEstimate.SelectedItem as EDetails).UCost = edtail.UCost;
             ((TextBlock)dgEstimate.Columns[5].GetCellContent(dgEstimate.SelectedItem)).Text =edtail.Amount.ToString();
             (dgEstimate.SelectedItem as EDetails).Amount = edtail.Amount;
             ((TextBlock)dgEstimate.Columns[6].GetCellContent(dgEstimate.SelectedItem)).Text = edtail.TaxRate.ToString();
             (dgEstimate.SelectedItem as EDetails).TaxRate = edtail.TaxRate;
             ((TextBlock)dgEstimate.Columns[7].GetCellContent(dgEstimate.SelectedItem)).Text = edtail.SCost.ToString();
             (dgEstimate.SelectedItem as EDetails).SCost = edtail.SCost;
             ((TextBlock)dgEstimate.Columns[8].GetCellContent(dgEstimate.SelectedItem)).Text = edtail.SupplierName;
             (dgEstimate.SelectedItem as EDetails).SupplierName = edtail.SupplierName;
             (dgEstimate.SelectedItem as EDetails).SCode = edtail.SCode;
             (dgEstimate.SelectedItem as EDetails).UCode = edtail.UCode;
             (dgEstimate.SelectedItem as EDetails).Product_Type = edtail.Product_Type;
             CalculateAmt();
             break;
         case "mnuExcel":
             Windows.CWEPrompt prompt = new Windows.CWEPrompt(est.Code);
             prompt.Show();
             prompt.OKButtonClicked += new EventHandler(SetFormClearX);
             break;
         case "mnuClose":
             db.CloseAsync();
             Frame fm = (Frame)this.Parent;
             if (fm != null) fm.Source = new Uri("/Pages/UIGraph.xaml", UriKind.Relative);
             break;
     }
 }
コード例 #3
0
 public void Print()
 {
     Windows.CWEPrompt prompt = new Windows.CWEPrompt(est.Code);
     prompt.Show();
     prompt.OKButtonClicked += new EventHandler(SetFormClear);
 }