Exemplo n.º 1
0
 private void Frm_DomAccept_Load(object sender, EventArgs e)
 {
     LoadCompanySource();
     LoadDataGridView(string.Empty);
     dgv_DataShow.ColumnHeadersDefaultCellStyle = DataGridViewStyleHelper.GetHeaderStyle();
     dgv_DataShow.DefaultCellStyle = DataGridViewStyleHelper.GetCellStyle();
 }
Exemplo n.º 2
0
        /// <summary>
        /// 加载当前意见
        /// </summary>
        private void Frm_Advice_Load(object sender, EventArgs e)
        {
            string querySql = $"SELECT a.qa_type, a.qa_advice FROM quality_advices a " +
                              $"WHERE qa_time = (SELECT MAX(qa_time) FROM quality_advices WHERE qa_obj_id = a.qa_obj_id AND qa_type = a.qa_type) " +
                              $"AND qa_obj_id='{objId}' ORDER BY a.qa_type";
            List <object[]> list = SqlHelper.ExecuteColumnsQuery(querySql, 2);

            for (int i = 0; i < list.Count; i++)
            {
                int index = dgv_BW.Rows.Add();
                dgv_BW.Rows[index].Cells[0].Value = GetTypeValue(list[i][0]);
                dgv_BW.Rows[index].Cells[1].Value = list[i][1];
            }

            dgv_BW.ColumnHeadersDefaultCellStyle = DataGridViewStyleHelper.GetHeaderStyle();
            dgv_BW.DefaultCellStyle = DataGridViewStyleHelper.GetCellStyle();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 加载历史意见
        /// </summary>
        private void Frm_Advice_Load(object sender, EventArgs e)
        {
            dgv_BW.Rows.Clear();
            string    querySql = $"SELECT qa_id, qa_type, qa_advice, qa_time FROM quality_advices WHERE qa_obj_id='{objId}' ORDER BY qa_type, qa_time";
            DataTable table    = SqlHelper.ExecuteQuery(querySql);

            foreach (DataRow row in table.Rows)
            {
                int index = dgv_BW.Rows.Add();
                dgv_BW.Rows[index].Tag            = row["qa_id"];
                dgv_BW.Rows[index].Cells[0].Value = GetTypeValue(row["qa_type"]);
                dgv_BW.Rows[index].Cells[1].Value = row["qa_advice"];
                dgv_BW.Rows[index].Cells[2].Value = row["qa_time"];
            }

            dgv_BW.ColumnHeadersDefaultCellStyle = DataGridViewStyleHelper.GetHeaderStyle();
            dgv_BW.DefaultCellStyle = DataGridViewStyleHelper.GetCellStyle();
        }