Пример #1
0
 /// <summary>
 /// 加载相关链接列表
 /// </summary>
 private void LoadFileLinkList(object fileId)
 {
     DataGridViewStyleHelper.ResetDataGridView(dgv_link, false);
     object[] links = SqlHelper.ExecuteSingleColumnQuery($"SELECT code FROM file_link WHERE fid='{fileId}'");
     if (links.Length > 0)
     {
         int rowCount = links.Length % dgv_link.ColumnCount == 0 ? links.Length / dgv_link.ColumnCount : links.Length / dgv_link.ColumnCount + 1;
         int index    = 0;
         for (int i = 0; i < rowCount; i++)
         {
             int j = dgv_link.Rows.Add();
             if (links.Length > index)
             {
                 dgv_link.Rows[j].Cells[0].Value = links[index++];
             }
             if (links.Length > index)
             {
                 dgv_link.Rows[j].Cells[1].Value = links[index++];
             }
             if (links.Length > index)
             {
                 dgv_link.Rows[j].Cells[2].Value = links[index++];
             }
         }
     }
 }
Пример #2
0
 private void Frm_DomAccept_Load(object sender, EventArgs e)
 {
     LoadCompanySource();
     LoadDataGridView(string.Empty);
     dgv_DataShow.ColumnHeadersDefaultCellStyle = DataGridViewStyleHelper.GetHeaderStyle();
     dgv_DataShow.DefaultCellStyle = DataGridViewStyleHelper.GetCellStyle();
 }
Пример #3
0
        private void LoadDataGridView(string unitId)
        {
            DataGridViewStyleHelper.ResetDataGridView(dgv_DataShow, true);
            dgv_DataShow.Columns.AddRange(new DataGridViewColumn[]
            {
                new DataGridViewTextBoxColumn()
                {
                    Name = "id"
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "unit", HeaderText = "来源单位", FillWeight = 15
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "code", HeaderText = "批次编号", FillWeight = 20
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "name", HeaderText = "批次名称", FillWeight = 20
                },
                new DataGridViewButtonColumn()
                {
                    Name = "file", HeaderText = "必备文件", FillWeight = 7
                },
                new DataGridViewButtonColumn()
                {
                    Name = "control", HeaderText = "操作", FillWeight = 7, Text = "结束", UseColumnTextForButtonValue = true
                },
            });
            dgv_DataShow.Columns["id"].Visible = false;

            string querySql = $"SELECT * FROM transfer_registration_pc LEFT JOIN data_dictionary ON dd_id = com_id " +
                              $"WHERE trp_work_status=2 ";

            if (!string.IsNullOrEmpty(unitId))
            {
                querySql += $" AND dd_id='{unitId}' ";
            }
            querySql += "ORDER BY trp_code";
            DataTable table = SqlHelper.ExecuteQuery(querySql);

            for (int i = 0; i < table.Rows.Count; i++)
            {
                DataGridViewRow newRow = dgv_DataShow.Rows[dgv_DataShow.Rows.Add()];
                newRow.Cells["id"].Value   = table.Rows[i]["trp_id"];
                newRow.Cells["unit"].Value = table.Rows[i]["dd_name"];
                newRow.Cells["code"].Value = table.Rows[i]["trp_code"];
                newRow.Cells["name"].Value = table.Rows[i]["trp_name"];
                newRow.Cells["file"].Value = GetFileCompleteResult(table.Rows[i]["trp_id"]);
            }
        }
Пример #4
0
        /// <summary>
        /// 加载光盘数据
        /// </summary>
        /// <param name="trpId">批次主键</param>
        private void LoadCDDataScoure(object trpId, object trpName)
        {
            DataGridViewStyleHelper.ResetDataGridView(dgv_SWDJ, true);
            dgv_SWDJ.Columns.AddRange(new DataGridViewColumn[]
            {
                new DataGridViewTextBoxColumn()
                {
                    Name = "trc_id", HeaderText = "主键", SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "trc_code", HeaderText = "光盘编号", FillWeight = 8, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "trc_name", HeaderText = "光盘名称", FillWeight = 10, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "trc_remark", HeaderText = "备注", FillWeight = 20, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewButtonColumn()
                {
                    Name = "trc_read", HeaderText = "操作", FillWeight = 5, Text = "读写", UseColumnTextForButtonValue = true, SortMode = DataGridViewColumnSortMode.NotSortable
                },
            });
            string    querySql  = $"SELECT trc_id, trc_name, trc_code, trc_remark FROM transfer_registraion_cd WHERE trp_id='{trpId}' ORDER BY trc_sort";
            DataTable dataTable = SqlHelper.ExecuteQuery(querySql);

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                DataRow row   = dataTable.Rows[i];
                int     index = dgv_SWDJ.Rows.Add();
                dgv_SWDJ.Rows[index].Cells["trc_id"].Value     = row["trc_id"];
                dgv_SWDJ.Rows[index].Cells["trc_code"].Value   = row["trc_code"];
                dgv_SWDJ.Rows[index].Cells["trc_name"].Value   = row["trc_name"];
                dgv_SWDJ.Rows[index].Cells["trc_remark"].Value = row["trc_remark"];
                dgv_SWDJ.Rows[index].Tag = trpId;
                dgv_SWDJ.Rows[index].Cells["trc_read"].Tag = trpName;
            }

            btn_Back.Enabled = true;
            btn_Add.Enabled  = false;
            dgv_SWDJ.Columns["trc_id"].Visible = false;
            btn_Delete.Tag = 2;
            this.BatchID   = trpId;
            this.BatchName = trpName;
        }
Пример #5
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();
        }
Пример #6
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();
        }
Пример #7
0
        private void Frm_AddPC_Load(object sender, EventArgs e)
        {
            //表头设置
            dgv_CDlist.ColumnHeadersDefaultCellStyle = DataGridViewStyleHelper.GetHeaderStyle();

            //列设置
            if (string.IsNullOrEmpty(txt_BatchCode.Text) && !"PC".Equals(unitCode))
            {
                CreateBatchCode(unitCode);
            }

            //隐藏光盘列表主键
            dgv_CDlist.Columns[0].Visible = false;

            Text = (isAdd ? "新增" : "修改") + "批次信息";

            txt_BatchName.Focus();
        }
Пример #8
0
        private void Frm_ToR_Load(object sender, EventArgs e)
        {
            //默认加载批次列表
            LoadPCDataScoure(null);

            //加载来源单位列表
            LoadCompanySource();
            btn_Back.Enabled = false;

            //默认查看状态为全部
            cbo_Status.SelectedIndex = 0;

            dgv_SWDJ.ColumnHeadersDefaultCellStyle = DataGridViewStyleHelper.GetHeaderStyle();
            dgv_GPDJ.ColumnHeadersDefaultCellStyle = DataGridViewStyleHelper.GetHeaderStyle();

            dgv_SWDJ.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            dgv_GPDJ.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
        }
Пример #9
0
 public BatchRecInfo(object trpID)
 {
     TRP_ID = trpID;
     InitializeComponent();
     view.RowHeadersDefaultCellStyle = DataGridViewStyleHelper.GetHeaderStyle();
 }
Пример #10
0
        /// <summary>
        /// 加载批次数据
        /// </summary>
        /// <param name="querySql">待加载的数据SQL</param>
        private void LoadPCDataScoure(string _querySql)
        {
            DataGridViewStyleHelper.ResetDataGridView(dgv_SWDJ, true);

            DataTable dataTable = null;

            //加载实物登记数据【默认加载状态为1(未提交)的数据】
            if (string.IsNullOrEmpty(_querySql))
            {
                StringBuilder querySql = new StringBuilder("SELECT pc.trp_id, dd_name, trp_name, trp_code,trp_submit_status,trp_cd_amount " +
                                                           "FROM transfer_registration_pc pc LEFT JOIN data_dictionary dd ON pc.com_id = dd.dd_id WHERE 1=1 ");
                if (!chk_AllP.Checked)
                {
                    querySql.Append($"AND trp_submit_status={(int)SubmitStatus.NonSubmit} ");
                }
                querySql.Append("ORDER BY trp_submit_status, trp_code;");
                dataTable = SqlHelper.ExecuteQuery(querySql.ToString());
            }
            else
            {
                dataTable = SqlHelper.ExecuteQuery(_querySql);
            }

            dgv_SWDJ.Columns.AddRange(new DataGridViewColumn[]
            {
                new DataGridViewTextBoxColumn()
                {
                    Name = "trp_id", HeaderText = "主键", FillWeight = 10, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "dd_name", HeaderText = "来源单位", FillWeight = 20, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "trp_name", HeaderText = "批次名称", FillWeight = 25, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewTextBoxColumn()
                {
                    Name = "trp_code", HeaderText = "批次编号", FillWeight = 20, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewLinkColumn()
                {
                    Name = "trp_cd_amount", HeaderText = "光盘数", FillWeight = 8, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewButtonColumn()
                {
                    Name = "addpc", HeaderText = "添加光盘", FillWeight = 10, Text = "添加", UseColumnTextForButtonValue = true, SortMode = DataGridViewColumnSortMode.NotSortable
                },
                new DataGridViewButtonColumn()
                {
                    Name = "submit", HeaderText = "提交", FillWeight = 10, SortMode = DataGridViewColumnSortMode.NotSortable
                },
            });
            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                DataRow row   = dataTable.Rows[i];
                int     index = dgv_SWDJ.Rows.Add();
                dgv_SWDJ.Rows[index].Cells["trp_id"].Value        = row["trp_id"];
                dgv_SWDJ.Rows[index].Cells["dd_name"].Value       = row["dd_name"];
                dgv_SWDJ.Rows[index].Cells["trp_name"].Value      = row["trp_name"];
                dgv_SWDJ.Rows[index].Cells["trp_code"].Value      = row["trp_code"];
                dgv_SWDJ.Rows[index].Cells["trp_cd_amount"].Value = row["trp_cd_amount"];
                dgv_SWDJ.Rows[index].Cells["submit"].Value        = Convert.ToInt32(row["trp_submit_status"]) == 1 ? "提交" : "已提交";
            }

            //设置链接按钮样式
            DataGridViewStyleHelper.SetAlignWithCenter(dgv_SWDJ, new string[] { "trp_cd_amount" });
            dgv_SWDJ.Columns["trp_id"].Visible = false;
            btn_Back.Enabled = false;
            btn_Add.Enabled  = true;

            btn_Delete.Tag = 1;
        }