コード例 #1
0
ファイル: FrmCluster.cs プロジェクト: nguyenhoanghai/PMS_Ver2
        private void LoadDataToCbbFloor()
        {
            try
            {
                var listFloor = new List <Floor>();
                listFloor.Add(new Floor()
                {
                    IdFloor = 0, Name = "(Chọn lầu của chuyền)"
                });
                var listFloorInDB = BLLFloor.GetAll(); // floorDAO.GetListFloor();
                if (listFloorInDB != null && listFloorInDB.Count > 0)
                {
                    listFloor.AddRange(listFloorInDB);
                }
                cbbFloor.DataSource    = listFloor;
                cbbFloor.DisplayMember = "Name";
                cbbFloor.ValueMember   = "IdFloor";

                var fl = listFloor.Where(x => x.IsDefault).FirstOrDefault();
                cbbFloor.SelectedValue = fl != null ? fl.IdFloor : 0;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        private void GetFloor()
        {
            var listFloor = BLLFloor.GetFloorForComBoBox();

            cbFloor.DataSource    = listFloor.SelectList;
            cbFloor.DisplayMember = "Name";
            cbFloor.ValueMember   = "IdFloor";
            cbFloor.SelectedValue = listFloor.DefaultValue;
            floorDefault          = listFloor.DefaultValue;
        }
コード例 #3
0
        private void LoadFloorToCbb()
        {
            var listFloor = BLLFloor.GetFloorForComBoBox();

            cboFloor.DataSource    = listFloor.SelectList;
            cboFloor.DisplayMember = "Name";
            cboFloor.ValueMember   = "IdFloor";
            cboFloor.SelectedValue = listFloor.DefaultValue;

            cboFloorProduct.DataSource    = listFloor.SelectList;
            cboFloorProduct.DisplayMember = "Name";
            cboFloorProduct.ValueMember   = "IdFloor";
            cboFloorProduct.SelectedValue = listFloor.DefaultValue;
        }
コード例 #4
0
 private void LoadFloorToCbb()
 {
     try
     {
         var list = BLLFloor.GetFloorForComBoBox();
         cboFloor.DataSource    = list.SelectList;
         cboFloor.DisplayMember = "Name";
         cboFloor.ValueMember   = "IdFloor";
         cboFloor.SelectedValue = list.DefaultValue;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Đã có lỗi xảy ra: " + ex.Message, "Lỗi xử lý", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #5
0
        private void LoadDataToCbbFloor()
        {
            try
            {
                var list = BLLFloor.GetFloorForComBoBox();
                cbFloor2.DataSource    = list.SelectList;
                cbFloor2.DisplayMember = "Name";
                cbFloor2.ValueMember   = "IdFloor";
                cbFloor2.SelectedValue = list.DefaultValue;

                cbbFloor.DataSource    = list.SelectList;
                cbbFloor.DisplayMember = "Name";
                cbbFloor.ValueMember   = "IdFloor";
                cbbFloor.SelectedValue = list.DefaultValue;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Lỗi Exception : lấy thông tin Lầu.\n" + ex.Message);
            }
        }