Esempio n. 1
0
        private void btnCreateMemo_Click(object sender, EventArgs e)
        {
            if (tblSelectedList.Rows.Count != 0)
            {
                thisArr = new string[tblSelectedList.Rows.Count];
                for (int i = 0; i < tblSelectedList.Rows.Count; i++)
                {
                    thisArr[i] = tblSelectedList.Rows[i].Cells[1].Value.ToString();
                }

                foreach (string i in thisArr)
                {
                    string _id        = csm.countSQL("select id from offensesnpenalty where concat(sec_code,' ',subsec_name) = '" + i + "'", "id");
                    string _Section   = csm.countSQL("select concat('SECTION ',sec_num, ' ',sec_name) as penalty from offensesnpenalty where concat(sec_code,' ',subsec_name) = '" + i + "'", "penalty");
                    string _paragraph = csm.countSQL("select concat('Paragraph ', sec_code,' ',description ) as penalty from offensesnpenalty where concat(sec_code,' ',subsec_name) = '" + i + "'", "penalty");
                    dgv.Rows.Add(_id, _Section, _paragraph);
                    using (NarrativeMemoForm nmf = new NarrativeMemoForm(user_id))
                    {
                        nmf.addtoPenalty(_id, memono);
                    }
                }
                this.Dispose();
            }
            else
            {
                MessageBox.Show("Select a section paragraph!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 2
0
 private void btnNotice_Click(object sender, EventArgs e)
 {
     using (NarrativeMemoForm nmf = new NarrativeMemoForm(user_id))
     {
         this.Dispose();
         nmf.ShowDialog();
     }
 }
Esempio n. 3
0
        private void forNoticetoExplain()
        {
            using (NarrativeMemoForm nmf = new NarrativeMemoForm(empid))
            {
                MySqlDataReader _reader = csm.sqlCommand("Select *,YEAR(nte.date_reported)as _year, Day(nte.date_reported)as _day, Month(nte.date_reported)as _mon, date_format(date_created, '%m/%d/%Y')as'datecreated' from noticetoexplain nte inner join record r on nte.memo_no = r.memo_no where nte.memo_no = '" + tblDraft.CurrentRow.Cells[0].Value.ToString() + "'").ExecuteReader();
                while (_reader.Read())
                {
                    nmf.lblGenRecNo.Text = _reader.GetString("memo_no");
                    nmf.txtDateNow.Text  = _reader.GetString("datecreated");
                    nmf.dtReported.Value = new DateTime(int.Parse(_reader.GetString("_year")), int.Parse(_reader.GetString("_mon")), int.Parse(_reader.GetString("_day")));
                    nmf.txtSubject.Text  = _reader.GetString("title");
                    nmf.txtFinding.Text  = _reader.GetString("findings");
                    nmf.txtMngComm.Text  = _reader.GetString("commentary");

                    nmf.ShowDialog();
                }
                csm.closeSql();
            }
        }
Esempio n. 4
0
        private void printPreview(string memono)
        {
            using (NarrativeMemoForm nmf = new NarrativeMemoForm(empid))
            {
                MySqlDataReader _reader = csm.sqlCommand("Select *,YEAR(nte.date_reported)as _year, Day(nte.date_reported)as _day, Month(nte.date_reported)as _mon, date_format(date_created, '%m/%d/%Y')as'datecreated' from noticetoexplain nte inner join record r on nte.memo_no = r.memo_no where nte.memo_no = '" + memono + "'").ExecuteReader();
                while (_reader.Read())
                {
                    nmf.lblGenRecNo.Text = _reader.GetString("memo_no");
                    nmf.txtDateNow.Text  = _reader.GetString("datecreated");
                    nmf.retrieveEmployee(_reader.GetString("empid_to"));
                    nmf.dtReported.Value = new DateTime(int.Parse(_reader.GetString("_year")), int.Parse(_reader.GetString("_mon")), int.Parse(_reader.GetString("_day")));
                    nmf.txtSubject.Text  = _reader.GetString("title");
                    nmf.txtFinding.Text  = _reader.GetString("findings");
                    nmf.txtMngComm.Text  = _reader.GetString("commentary");

                    nmf.printPreview();
                }
            }
        }