コード例 #1
0
 public void ShowToolList(ref ComboBox cbo)
 {
     try
     {
         Log.AppendText("กำลังเรียกข้อมูล Tools...");
         ManageBiz ms = new ManageBiz();
         DataTable dtUser;
         dtUser         = ms.GetToolList();
         cbo.DataSource = null;
         if (dtUser.Rows.Count > 0)
         {
             cbo.DataSource    = dtUser;
             cbo.DisplayMember = "ToolType";
             cbo.ValueMember   = "ToolType";
             Log.AppendText("เรียกข้อมูล Tools เรียบร้อย");
         }
         else
         {
             Log.AppendText("ไม่พบข้อมูล Tools");
         }
     }
     catch (Exception ex)
     {
         Log.AppendText(ex.Message);
         MessageBox.Show(ex.Message);
         cbo.DataSource = null;
     }
 }
コード例 #2
0
        public void LoadConnectorSpec(string connectorType, ref ComboBox _ToolType, ref ComboBox _ProfileName, ref TextBox _Pins,
                                      ref TextBox _baseThickness, ref TextBox _unseatedTop, ref TextBox _height, ref TextBox _seatedHeight,
                                      ref TextBox _graphFPerPin, ref TextBox _graphDistance,
                                      ref TextBox _minFPerPin, ref TextBox _maxFPerPin, ref TextBox _userFPerPin, ref TextBox _otherForce,
                                      ref TextBox _parsPercent, ref TextBox _parsStartHeight, ref TextBox _parsDistance,
                                      ref TextBox _gradDegrees, ref TextBox _comments)
        {
            try
            {
                Log.AppendText("กำลังเรียกข้อมูล Connector spec. {" + connectorType + "}");

                DataTable dtConnector   = new DataTable();
                DataTable dtToolType    = new DataTable();
                DataTable dtProfileName = new DataTable();
                ManageBiz ms            = new ManageBiz();

                dtConnector   = ms.GetConnectorBy(connectorType);
                dtToolType    = ms.GetToolList();
                dtProfileName = ms.GetProfileList();

                if (dtConnector.Rows.Count > 0)
                {
                    _ToolType.DataSource    = null;
                    _ToolType.DataSource    = dtToolType;
                    _ToolType.DisplayMember = "ToolType";
                    _ToolType.ValueMember   = "ToolType";
                    _ToolType.Text          = dtConnector.Rows[0]["ToolType"].ToString();

                    _ProfileName.DataSource    = null;
                    _ProfileName.DataSource    = dtProfileName;
                    _ProfileName.DisplayMember = "ProfileName";
                    _ProfileName.ValueMember   = "ProfileName";
                    _ProfileName.Text          = dtConnector.Rows[0]["ProfileName"].ToString();

                    _Pins.Text = dtConnector.Rows[0]["NumberOfPins"].ToString();

                    _baseThickness.Text = dtConnector.Rows[0]["BaseThickness"].ToString();
                    _unseatedTop.Text   = dtConnector.Rows[0]["UnseatedTop"].ToString();
                    _height.Text        = dtConnector.Rows[0]["Height"].ToString();
                    _seatedHeight.Text  = dtConnector.Rows[0]["SeatedHeight"].ToString();

                    _graphFPerPin.Text  = dtConnector.Rows[0]["GraphFPerPin"].ToString();
                    _graphDistance.Text = dtConnector.Rows[0]["GraphDistance"].ToString();

                    _minFPerPin.Text  = dtConnector.Rows[0]["MinFPerPin"].ToString();
                    _maxFPerPin.Text  = dtConnector.Rows[0]["MaxFPerPin"].ToString();
                    _userFPerPin.Text = dtConnector.Rows[0]["UserFPerPin"].ToString();
                    _userFPerPin.Text = dtConnector.Rows[0]["OtherForce"].ToString();

                    _parsPercent.Text     = dtConnector.Rows[0]["PARSPercent"].ToString();
                    _parsStartHeight.Text = dtConnector.Rows[0]["PARSStartHeight"].ToString();
                    _parsDistance.Text    = dtConnector.Rows[0]["PARSDistance"].ToString();

                    _gradDegrees.Text = dtConnector.Rows[0]["FGradDegrees"].ToString();

                    _comments.Text = dtConnector.Rows[0]["Comments"].ToString();

                    Log.AppendText("เรียกข้อมูล Tools เรียบร้อย");
                }
                else
                {
                    Log.AppendText("ไม่พบข้อมูล Tools");
                }
            }
            catch (Exception ex) { Log.AppendText(ex.Message); MessageBox.Show(ex.Message); }
        }