Example #1
0
        private void dtalent_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 2)
            {
                frmSuperComboboxForm scf = new frmSuperComboboxForm();
                scf.Text = "请选择人才计划名称!";
                List <string> itemList = new List <string>();
                itemList.Add("国家“千人计划”创新人才长期项目");
                itemList.Add("国家“千人计划”创新人才短期项目");
                itemList.Add("国家“千人计划”青年项目");
                itemList.Add("国家“万人计划”杰出人才项目");
                itemList.Add("国家“万人计划”领军人才项目");
                itemList.Add("国家“万人计划”青年拔尖人才项目");
                itemList.Add("教育部“长江学者奖励计划”特聘教授");
                itemList.Add("教育部“长江学者奖励计划”讲座教授");
                itemList.Add("教育部“长江学者奖励计划”青年学者");
                itemList.Add("国家自然科学基金委杰出青年基金");
                itemList.Add("国家自然科学基金委优秀青年基金");
                itemList.Add("科技部“创新人才推进计划”中青年科技领军人才");
                itemList.Add("科技部“创新人才推进计划”重点领域创新团队带头人");
                itemList.Add("人社部“百万人才工程”国家级人选");
                itemList.Add("军队科技领军人才");
                itemList.Add("军队科技领军人才培养对象");
                itemList.Add("军队学科拔尖人才");
                itemList.Add("军队学科拔尖人才培养对象");

                scf.InitComboboxList(itemList.ToArray());
                scf.SelectItem(this.dtalent.Rows[e.RowIndex].Cells[2].Value != null ? this.dtalent.Rows[e.RowIndex].Cells[2].Value.ToString() : string.Empty);

                if (scf.ShowDialog() == DialogResult.OK)
                {
                    this.dtalent.Rows[e.RowIndex].Cells[2].Value = scf.SelectedItem;
                }
            }

            int columnIndex = e.ColumnIndex;
            int rowIndex    = e.RowIndex;

            if (rowIndex == -1)
            {
                return;
            }
            if (this.dtalent.Columns[columnIndex].Name == "up")
            {
                if (rowIndex == 0 || rowIndex == this.dtalent.RowCount - 1)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow = this.dtalent.Rows[rowIndex];
                this.dtalent.Rows.Remove(dataGridViewRow);
                this.dtalent.Rows.Insert(rowIndex - 1, dataGridViewRow);
                this.dtalent.ClearSelection();
                return;
            }
            else if (this.dtalent.Columns[columnIndex].Name == "down")
            {
                if (rowIndex >= this.dtalent.RowCount - 2)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow2 = this.dtalent.Rows[rowIndex];
                this.dtalent.Rows.Remove(dataGridViewRow2);
                this.dtalent.Rows.Insert(rowIndex + 1, dataGridViewRow2);
                this.dtalent.ClearSelection();
                return;
            }
            else
            {
                if (!(this.dtalent.Columns[columnIndex].Name == "delete"))
                {
                    if (this.dtalent.Columns[columnIndex].Name == "selpersonname" && this.dtalent[columnIndex, rowIndex].Value != null && this.dtalent[columnIndex, rowIndex].Value.ToString() == "其他")
                    {
                        this.dtalent[columnIndex, rowIndex].Value = "";
                    }
                    return;
                }
                if (rowIndex == this.dtalent.RowCount - 1)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow3 = this.dtalent.Rows[rowIndex];
                if (dataGridViewRow3.Cells["selpersonid"].Value != null)
                {
                    this._deletedNo.Add(dataGridViewRow3.Cells["selpersonid"].Value.ToString());
                    this._talentsPlanService.DeleteTalentsPlans(this._deletedNo);
                    this._deletedNo.Clear();
                }
                this.dtalent.Rows.Remove(dataGridViewRow3);
                this.dtalent.ClearSelection();
                return;
            }
        }
Example #2
0
        private void dTechnologyAwards_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 2)
            {
                frmSuperComboboxForm scf = new frmSuperComboboxForm();
                scf.Text = "请选择奖励类别及等级!";
                List <string> list = new List <string>();
                list.Add("国家最高科技技术奖");
                list.Add("国家科学技术进步奖特等奖");
                list.Add("国家科学技术进步奖一等奖");
                list.Add("国家科学技术进步奖二等奖");
                list.Add("国家自然科学奖一等奖");
                list.Add("国家自然科学奖二等奖");
                list.Add("国家技术发明奖一等奖");
                list.Add("国家技术发明奖二等奖");
                list.Add("国防科学技术进步奖特等奖");
                list.Add("国防科学技术进步奖一等奖");
                list.Add("国防科学技术进步奖二等奖");
                list.Add("国防技术发明特等奖");
                list.Add("国防技术发明一等奖");
                list.Add("国防技术发明二等奖");
                list.Add("军队科学技术进步一等奖");
                list.Add("军队科学技术进步二等奖");
                list.Add("军队技术侦查成果奖一等奖");
                list.Add("军队技术侦查成果奖二等奖");
                list.Add("军队教学成果一等奖");
                list.Add("军队教学成果二等奖");
                list.Add("军队医疗成果一等奖");
                list.Add("军队医疗成果二等奖");
                scf.InitComboboxList(list.ToArray());
                scf.SelectItem(this.dTechnologyAwards.Rows[e.RowIndex].Cells[2].Value != null ? this.dTechnologyAwards.Rows[e.RowIndex].Cells[2].Value.ToString() : string.Empty);
                if (scf.ShowDialog() == DialogResult.OK)
                {
                    this.dTechnologyAwards.Rows[e.RowIndex].Cells[2].Value = scf.SelectedItem;
                }
            }

            int columnIndex = e.ColumnIndex;
            int rowIndex    = e.RowIndex;

            if (rowIndex == -1)
            {
                return;
            }
            if (this.dTechnologyAwards.Columns[columnIndex].Name == "scienceup")
            {
                if (rowIndex == 0 || rowIndex == this.dTechnologyAwards.RowCount - 1)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow = this.dTechnologyAwards.Rows[rowIndex];
                this.dTechnologyAwards.Rows.Remove(dataGridViewRow);
                this.dTechnologyAwards.Rows.Insert(rowIndex - 1, dataGridViewRow);
                this.dTechnologyAwards.ClearSelection();
                return;
            }
            else if (this.dTechnologyAwards.Columns[columnIndex].Name == "sciencedown")
            {
                if (rowIndex >= this.dTechnologyAwards.RowCount - 2)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow2 = this.dTechnologyAwards.Rows[rowIndex];
                this.dTechnologyAwards.Rows.Remove(dataGridViewRow2);
                this.dTechnologyAwards.Rows.Insert(rowIndex + 1, dataGridViewRow2);
                this.dTechnologyAwards.ClearSelection();
                return;
            }
            else
            {
                if (!(this.dTechnologyAwards.Columns[columnIndex].Name == "sciencedelete"))
                {
                    if (this.dTechnologyAwards.Columns[columnIndex].Name == "scienceattup")
                    {
                        OpenFileDialog openFileDialog = new OpenFileDialog();
                        openFileDialog.Filter      = "Adobe PDF 文件,JPEG图像文件|*.pdf;*.jpg;*.jpeg";
                        openFileDialog.Multiselect = false;
                        if (openFileDialog.ShowDialog() == DialogResult.OK)
                        {
                            this.dTechnologyAwards["scienceattainfo", rowIndex].Value = openFileDialog.FileName;
                            this.dTechnologyAwards["UpLoadFullyName", rowIndex].Value = openFileDialog.FileName;
                            return;
                        }
                    }
                    else if (this.dTechnologyAwards.Columns[columnIndex].Name == "scienceattainfo")
                    {
                        if (this.dTechnologyAwards["hiddenStoreName", rowIndex].Value != null)
                        {
                            if (File.Exists(Path.Combine(EntityElement.FilesStorePath, this.dTechnologyAwards["hiddenStoreName", rowIndex].Value.ToString())))
                            {
                                FileOp.OpenFile(Path.Combine(EntityElement.FilesStorePath, this.dTechnologyAwards["hiddenStoreName", rowIndex].Value.ToString()));
                                return;
                            }
                            MessageBox.Show("文件不存在。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            return;
                        }
                        else if (this.dTechnologyAwards["UpLoadFullyName", rowIndex].Value != null)
                        {
                            if (File.Exists(this.dTechnologyAwards["UpLoadFullyName", rowIndex].Value.ToString()))
                            {
                                FileOp.OpenFile(this.dTechnologyAwards["UpLoadFullyName", rowIndex].Value.ToString());
                                return;
                            }
                            MessageBox.Show("文件不存在。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                    }
                    return;
                }
                if (rowIndex == this.dTechnologyAwards.RowCount - 1)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow3 = this.dTechnologyAwards.Rows[rowIndex];
                if (dataGridViewRow3.Cells["scienceid"].Value != null)
                {
                    string str = "";
                    if (dataGridViewRow3.Cells["hiddenStoreName"].Value != null && dataGridViewRow3.Cells["hiddenStoreName"].Value != DBNull.Value)
                    {
                        str = dataGridViewRow3.Cells["hiddenStoreName"].Value.ToString();
                    }
                    this._deletedNo.Add(dataGridViewRow3.Cells["scienceid"].Value.ToString() + "|" + str);
                    this._technologyAwardsService.DeleteRTreatisess(this._deletedNo);
                    this._deletedNo.Clear();
                }
                this.dTechnologyAwards.Rows.Remove(dataGridViewRow3);
                this.dTechnologyAwards.ClearSelection();
                return;
            }
        }
Example #3
0
        private void dRTreatises_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 5)
            {
                frmSuperComboboxForm scf = new frmSuperComboboxForm();
                scf.Text = "请选择收录及引用情况!";
                List <string> list = new List <string>();
                list.Add("SCI");
                list.Add("EI");
                scf.InitComboboxList(list.ToArray());
                scf.SelectItem(this.dRTreatises.Rows[e.RowIndex].Cells[5].Value != null ? this.dRTreatises.Rows[e.RowIndex].Cells[5].Value.ToString() : string.Empty);
                if (scf.ShowDialog() == DialogResult.OK)
                {
                    this.dRTreatises.Rows[e.RowIndex].Cells[5].Value = scf.SelectedItem;
                }
            }

            int columnIndex = e.ColumnIndex;
            int rowIndex    = e.RowIndex;

            if (rowIndex == -1)
            {
                return;
            }
            if (this.dRTreatises.Columns[columnIndex].Name == "paperup")
            {
                if (rowIndex == 0 || rowIndex == this.dRTreatises.RowCount - 1)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow = this.dRTreatises.Rows[rowIndex];
                this.dRTreatises.Rows.Remove(dataGridViewRow);
                this.dRTreatises.Rows.Insert(rowIndex - 1, dataGridViewRow);
                this.dRTreatises.ClearSelection();
                return;
            }
            else if (this.dRTreatises.Columns[columnIndex].Name == "paperdown")
            {
                if (rowIndex >= this.dRTreatises.RowCount - 2)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow2 = this.dRTreatises.Rows[rowIndex];
                this.dRTreatises.Rows.Remove(dataGridViewRow2);
                this.dRTreatises.Rows.Insert(rowIndex + 1, dataGridViewRow2);
                this.dRTreatises.ClearSelection();
                return;
            }
            else
            {
                if (!(this.dRTreatises.Columns[columnIndex].Name == "paperdel"))
                {
                    if (this.dRTreatises.Columns[columnIndex].Name == "paperattachmentup")
                    {
                        OpenFileDialog openFileDialog = new OpenFileDialog();
                        openFileDialog.Filter      = "Adobe PDF 文件,JPEG图像文件|*.pdf;*.jpg;*.jpeg";
                        openFileDialog.Multiselect = false;
                        if (openFileDialog.ShowDialog() == DialogResult.OK)
                        {
                            this.dRTreatises["paperattachmentinfo", rowIndex].Value = openFileDialog.FileName;
                            this.dRTreatises["uploadfullpath", rowIndex].Value      = openFileDialog.FileName;
                            return;
                        }
                    }
                    else if (this.dRTreatises.Columns[columnIndex].Name == "paperattachmentinfo")
                    {
                        if (this.dRTreatises["hiddenRTreatisesPDFOName", rowIndex].Value != null)
                        {
                            if (File.Exists(Path.Combine(EntityElement.FilesStorePath, this.dRTreatises["hiddenRTreatisesPDFOName", rowIndex].Value.ToString())))
                            {
                                FileOp.OpenFile(Path.Combine(EntityElement.FilesStorePath, this.dRTreatises["hiddenRTreatisesPDFOName", rowIndex].Value.ToString()));
                                return;
                            }
                            MessageBox.Show("文件不存在。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            return;
                        }
                        else if (this.dRTreatises["uploadfullpath", rowIndex].Value != null)
                        {
                            if (File.Exists(this.dRTreatises["uploadfullpath", rowIndex].Value.ToString()))
                            {
                                FileOp.OpenFile(this.dRTreatises["uploadfullpath", rowIndex].Value.ToString());
                                return;
                            }
                            MessageBox.Show("文件不存在。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        }
                    }
                    return;
                }
                if (rowIndex == this.dRTreatises.RowCount - 1)
                {
                    return;
                }
                DataGridViewRow dataGridViewRow3 = this.dRTreatises.Rows[rowIndex];
                if (dataGridViewRow3.Cells["paperid"].Value != null)
                {
                    string str = "";
                    if (dataGridViewRow3.Cells["hiddenRTreatisesPDFOName"].Value != null && dataGridViewRow3.Cells["hiddenRTreatisesPDFOName"].Value != DBNull.Value)
                    {
                        str = dataGridViewRow3.Cells["hiddenRTreatisesPDFOName"].Value.ToString();
                    }
                    this._deletedNo.Add(dataGridViewRow3.Cells["paperid"].Value.ToString() + "|" + str);
                    this._rTreatisesService.DeleteRTreatisess(this._deletedNo);
                    this._deletedNo.Clear();
                }
                this.dRTreatises.Rows.Remove(dataGridViewRow3);
                this.dRTreatises.ClearSelection();
                return;
            }
        }