コード例 #1
0
 private void FillRig()
 {
     try
     {
         DataSet dsRig = well.fillRig();
         lstRig.Properties.DataSource    = dsRig.Tables[0];
         lstRig.Properties.DisplayMember = "RigName";
         lstRig.Properties.ValueMember   = "RigId";
         lstRig.Properties.NullText      = "";
         lstRig.Properties.PopulateColumns();
         lstRig.Properties.Columns["RigId"].Visible = false;
         lstRig.Properties.ShowHeader = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.InnerException == null ? ex.Message : ex.InnerException.Message);
     }
 }
コード例 #2
0
ファイル: Well.cs プロジェクト: sreekantha86/rmsbysreekanth
        private void FillDropDowns()
        {
            try
            {
                DataSet dsLoc = well.fillLocation();
                lstLocation.Properties.DataSource    = dsLoc.Tables[0];
                lstLocation.Properties.DisplayMember = "LocName";
                lstLocation.Properties.ValueMember   = "LocId";
                lstLocation.Properties.NullText      = "";
                lstLocation.Properties.PopulateColumns();
                lstLocation.Properties.Columns["LocId"].Visible = false;
                lstLocation.Properties.ShowHeader = false;

                DataSet dsWellType = well.fillWellType();
                lstWellType.Properties.DataSource    = dsWellType.Tables[0];
                lstWellType.Properties.DisplayMember = "WellTypeName";
                lstWellType.Properties.ValueMember   = "WellTypeId";
                lstWellType.Properties.NullText      = "";
                lstWellType.Properties.PopulateColumns();
                lstWellType.Properties.Columns["WellTypeId"].Visible = false;
                lstWellType.Properties.ShowHeader = false;

                DataSet dsRig = well.fillRig();
                lstRig.Properties.DataSource    = dsRig.Tables[0];
                lstRig.Properties.DisplayMember = "RigName";
                lstRig.Properties.ValueMember   = "RigId";
                lstRig.Properties.NullText      = "";
                lstRig.Properties.PopulateColumns();
                lstRig.Properties.Columns["RigId"].Visible = false;
                lstRig.Properties.ShowHeader = false;

                if (RigId > 0)
                {
                    lstRig.EditValue = RigId;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.InnerException == null ? ex.Message : ex.InnerException.Message);
            }
        }