/// <summary>
 /// 
 /// </summary>
 public UIRequisition()
 {
     InitializeComponent();
     opMod =(int) Common.opmode;
     req = Common.requisition;
     if (App.Current.IsRunningOutOfBrowser)
     {
         dynamic wscript = AutomationFactory.CreateObject("WScript.Network");
         pcName = (string)wscript.ComputerName;
     }
     this.LayoutRoot.DataContext = new DBService.Requisition();            
     db.UpdateRequisitionCompleted += new EventHandler<UpdateRequisitionCompletedEventArgs>(db_UpdateRequisitionCompleted);
     xmlFile = new XMLFile();
     this.BindingValidationError += new EventHandler<ValidationErrorEventArgs>(UIRequisition_BindingValidationError);
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pAction"></param>
        private void UpdateDataBase(char pAction)
        {
            if (!Common.IsConnected)
            {
                MessageBox.Show("ネットワークに接続していません。");
                return;
            }
            int cnt = 1;
            DBService.Requisition requisition = new DBService.Requisition();
            requisition.Code = reqCode;
            requisition.Req_No = txtReqNo.Text;
            requisition.CreationDate = DateTime.Parse(dtpCreateDate.Text);
            requisition.CustCode = Common.customer.Code;
            requisition.Del_Flg = false;
            requisition.Title = txtTitle.Text;
            requisition.Remarks1 = txtMemo1.Text;            
            requisition.StaffCode = Common.staff.Code;
            requisition.Estimate_No = txtEstNo.Text;
            if (chkIssueDate.IsChecked == true)
                requisition.IssueDate = DateTime.Now;
            else
                requisition.IssueDate = null;

            ObservableCollection<DBService.RDetails> rdetails = new ObservableCollection<DBService.RDetails>();
            foreach (DBService.RDetails rdetail in dgRequisition.ItemsSource)
            {
                if (rdetail.Product != null)
                    if (rdetail.Product.Length != 0)
                    {
                        rdetail.No = cnt;
                        cnt += 1;
                    }
                rdetails.Add(rdetail);
            }
            requisition.RDetails = rdetails;
            db.UpdateRequisitionAsync(requisition, Common.staff.Nm, pcName, pAction);
        }
 public UIRequisitionDisplay()
 {
     InitializeComponent();
     req = Common.requisition;
     this.LayoutRoot.DataContext = new DBService.Requisition();
 }