Esempio n. 1
0
        /// <summary>
        /// 在选中询价单时在右边的DataGrid显示对应的报价单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataGridRow_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            try
            {
                //先清空之前的信息
                _quo.Clear();

                //获取选中的数据行
                RFQItem info = null;
                if (sender != null)
                {
                    DataGridRow grid = sender as DataGridRow;
                    info = grid.Item as RFQItem;
                }
                DataTable dataTable = Database.FillDataTable(
                    "SELECT Quotation_id_PK, Quotation_source, Supplier_id_FK, Quotation_createdate,Quotation_notes " +
                    "FROM Quotation WHERE RFQ_id_FK=" + info.NO);
                foreach (DataRow row in dataTable.Rows)
                {
                    QuoItem tempItem = new QuoItem((int)row["Quotation_id_PK"], (string)row["Quotation_source"],
                                                   (int)row["Supplier_id_FK"], (DateTime)row["Quotation_createdate"],
                                                   (string)row["Quotation_notes"], false, info.NO);
                    _quo.Add(tempItem);
                }
            }
            catch (Exception ex)
            {
                Tools.ShowMessageBox(ex.Message);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 在选中报价单时在下面的DataGrid显示对应的具体报价
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void QuoDataGridRow_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            //先清空之前的信息
            _info.Clear();

            //获取选中的数据行
            QuoItem info = null;

            if (sender != null)
            {
                DataGridRow grid = sender as DataGridRow;
                info = grid.Item as QuoItem;
            }
            FillInfo(info);
        }
Esempio n. 3
0
 public void FillInfo(QuoItem info)
 {
     try
     {
         DataTable dataTable = Database.FillDataTable(
             "SELECT Product_category, Product_name, " +
             "Product_modle, Num_of_product, Price FROM " +
             "Order_information INNER JOIN Quotation_information " +
             "ON Order_information.Order_information_form_id_PK=Quotation_information.Order_information_form_id_FK" +
             " WHERE Quotation_information.Quotation_id_FK=" + info.NO);
         foreach (DataRow row in dataTable.Rows)
         {
             Info tempItem = new Info((string)row["Product_category"], (string)row["Product_name"],
                                      (string)row["Product_modle"], (int)row["Num_of_product"],
                                      (decimal)row["Price"]);
             _info.Add(tempItem);
         }
     }
     catch (Exception ex)
     {
         Tools.ShowMessageBox(ex.Message);
     }
 }