Example #1
0
 private void toolStripButton8_Click(object sender, EventArgs e)
 {
     if ((this.dataGridView1.DataSource != null) && (MessageBox.Show("确定要删除该报表码?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK))
     {
         HisReport.DeleteReport(((DataTable)this.dataGridView1.DataSource).DefaultView.ToTable().Rows[this.dataGridView1.CurrentCell.RowIndex]["ReportPath"].ToString());
         this.dataGridView1.DataSource = HisReport.LoadReports();
     }
 }
Example #2
0
        public FrmHisReport(long currentUserId, long currentDeptId, string chineseName)
        {
            InitializeComponent();
            _currentUser = new User(currentUserId);
            _currentDept = new Deptment(currentDeptId);

            this.Text = chineseName;
            this.dataGridView1.DataSource = HisReport.LoadReports();
        }
Example #3
0
 private void AddReport()
 {
     HIS.Model.HIS_Report Erpt = new HIS.Model.HIS_Report();
     Erpt.ReportName    = this.tb_RptName.Text.Trim();
     Erpt.ReportPath    = this.tb_rptPath.Text.Trim();
     Erpt.BuildEmpCode  = UserID;
     Erpt.BuildEmpName  = UserName;
     Erpt.BuildDateTime = DateTime.Now;
     HisReport.AddReport(Erpt);
 }
Example #4
0
 private void toolStripButton6_Click(object sender, EventArgs e)
 {
     try
     {
         int    rptid   = Convert.ToInt32(((DataTable)this.dataGridView1.DataSource).DefaultView.ToTable().Rows[this.dataGridView1.CurrentCell.RowIndex]["ReportID"]);
         string rptName = ((DataTable)this.dataGridView1.DataSource).DefaultView.ToTable().Rows[this.dataGridView1.CurrentCell.RowIndex]["ReportName"].ToString();
         string rptPath = ((DataTable)this.dataGridView1.DataSource).DefaultView.ToTable().Rows[this.dataGridView1.CurrentCell.RowIndex]["ReportPath"].ToString();
         new FrmNewReport(this._currentUser.EmployeeID.ToString(), this._currentUser.Name, rptid, rptName, rptPath).ShowDialog();
         this.dataGridView1.DataSource = HisReport.LoadReports();
     }
     catch
     {
     }
 }
Example #5
0
        private void UpdateReport()
        {
            try
            {
                HIS.Model.HIS_Report Erpt = new HIS.Model.HIS_Report();
                Erpt.ReportID      = RptID;
                Erpt.ReportName    = this.tb_RptName.Text.Trim();
                Erpt.ReportPath    = this.tb_rptPath.Text.Trim();
                Erpt.BuildEmpCode  = UserID;
                Erpt.BuildEmpName  = UserName;
                Erpt.BuildDateTime = DateTime.Now;

                HisReport.UpdateReport(Erpt);
            }
            catch (System.Exception e)
            {
                throw new Exception(e.Message);
            }
        }
Example #6
0
 private void toolStripButton7_Click(object sender, EventArgs e)
 {
     this.dataGridView1.DataSource = null;
     this.dataGridView1.DataSource = HisReport.LoadReports();
 }
Example #7
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     new FrmNewReport(this._currentUser.EmployeeID.ToString(), this._currentUser.Name).ShowDialog();
     this.dataGridView1.DataSource = HisReport.LoadReports();
 }