예제 #1
0
        public SubRiskForm(DataGridViewCell _dgvCell, string _connectionString, MainRiskForm _form, bool readOnly)
        {
            this.readOnly = readOnly;

            try
            {
                dgvCell = _dgvCell;
                form = _form;
                connectionString = _connectionString;
                InitializeComponent();

                if (readOnly)
                {
                    saveToolStripMenuItem.Enabled = false;
                }
                init();
                Dates dates = new Dates(form);
                this.lblFromDate.Text = dates.FromDate.ToShortDateString();
                lblToDate.Text = dates.ToDate.ToShortDateString();
                dtp.Value = dates.EvalDate;
            }
            catch (Exception)
            {
                return;
            }

        }
예제 #2
0
        private void dgvRisks_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            MainRiskForm mainRisk = new MainRiskForm(dgvRisks.CurrentCell, connectionString, dtp.Value.Date, readOnly);

            try
            {
                mainRisk.Show();
            }
            catch (Exception)
            { }
        }
예제 #3
0
        public ChooseSubRisk(string _connectionString, MainRiskForm _form)
        {
            connectionString = _connectionString;
            form             = _form;
            InitializeComponent();
            string SQL = "Select " +
                         "* " +
                         "FROM " +
                         "[Documents].[SubRisk] " +
                         "WHERE 1=1" +
                         "AND [ToDate] > @EvalDate " +
                         "AND [FromDate] <= @EvalDate";

            using (var dt = RiskTextForm.SQLQuery(SQL, connectionString, new Dates(form), true))
            {
                foreach (DataRow row in dt.Rows)
                {
                    int rowIndex = dgvSubrisks.Rows.Add();
                    dgvSubrisks.Rows[rowIndex].Cells["SubRiskID"].Value   = row["SubRiskID"].ToString();
                    dgvSubrisks.Rows[rowIndex].Cells["SubRiskIK"].Value   = row["SubRiskIK"].ToString();
                    dgvSubrisks.Rows[rowIndex].Cells["SubRiskType"].Value = row["SubRiskType"].ToString();
                }
            }
        }
예제 #4
0
파일: Dates.cs 프로젝트: glenhojer/RiskText
 public Dates(MainRiskForm form)
 {
     EvalDate = form.dtp.Value.Date;
     FromDate = DateTime.Parse(form.lblFromDate.Text);
     ToDate   = DateTime.Parse(form.lblToDate.Text);
 }
예제 #5
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MainRiskForm mainRisk = new MainRiskForm(dgvRisks.CurrentCell, connectionString, dtp.Value.Date, readOnly);

            mainRisk.Show();
        }