Beispiel #1
0
        //End SingleTon

        private void FrmBOM_Load(object sender, EventArgs e)
        {
            dataGridViewProjects.AllowUserToDeleteRows = false;
            try
            {
                _mrvc    = new MRVersionController();
                _LstMRVs = _mrvc.GetModels();

                _dtMRVs = ToDataTable <MRVersion>(_LstMRVs);
                _dtMRVs.Columns.Remove("Project");
                _dtMRVs.Columns.Remove("MRs");

                _dtMRVs.Columns.Remove("IsModified");

                //_dtProjects.Columns.Remove("ProjectEmployeeDetails");
                //_dtProjects.Columns.Remove("CreatedBy");
                //_dtProjects.Columns.Remove("UpdatedBy");

                DataView dv = _dtMRVs.DefaultView;
                dv.Sort = "DateCreated desc";
                _dtMRVs = dv.ToTable();

                dataGridViewProjects.DataSource                      = _dtMRVs;
                dataGridViewProjects.Columns["Id"].Visible           = false;
                dataGridViewProjects.Columns["VersionNo"].HeaderText = "MIR Number";
                if (_LstMRVs.Count == 0)
                {
                    _newMode = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        //End SingleTon

        private void FrmBOM_Load(object sender, EventArgs e)
        {
            try
            {
                if (LoginInfo.LoginEmployee.EmployeeTypeCode == Constants.EMPLOYEE)
                {
                }

                _currentLoadedProject = CurrentOpenProject.CurrentProject;

                _mrvc         = new MRVersionController();
                _LstMRVersion = _mrvc.GetModels();

                //_mrc = new MRController();
                //_mrc.GetModelByID()

                var bindingSource3 = new BindingSource();
                //_LstMRVersion= _LstMRVersion.OrderByDescending(c => c.Version).ToList();
                bindingSource3.DataSource = _LstMRVersion.OrderByDescending(c => c.VersionNo).ToList();

                cmbMRList.DisplayMember = "VersionNo";
                cmbMRList.ValueMember   = "Id";
                cmbMRList.SelectedIndex = -1;
                cmbMRList.DataSource    = bindingSource3.DataSource;
                if (cmbMRList.Items.Count == 0)
                {
                    MessageBox.Show("Please first create Material Request"); btnSave.Enabled = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }