예제 #1
0
        private void item_list_dateail(string condition)
        {
            try
            {
                wnDm          wDm = new wnDm();
                DataTable     dt  = null;
                StringBuilder sb  = new StringBuilder();


                sb.AppendLine(condition);
                sb.AppendLine(" AND C.F_SUB_DATE >= '" + start_date.Text.ToString() + "'  AND C.F_SUB_DATE <= '" + end_date.Text.ToString() + "'");

                //WNDM 12931번째 줄

                dt = wDm.Item_Grid_List_Detail(sb.ToString());


                if (dt != null && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dgv_item_list.Rows.Add();
                        dgv_item_list.Rows[i].Cells["LOT_NO"].Value  = dt.Rows[i]["LOT_NO"].ToString();
                        dgv_item_list.Rows[i].Cells["LOT_SUB"].Value = dt.Rows[i]["LOT_SUB"].ToString();
                        dgv_item_list.Rows[i].Cells["SEQ"].Value     = dt.Rows[i]["SEQ"].ToString();
                        dgv_item_list.Rows[i].Cells["제품명"].Value     = dt.Rows[i]["ITEM_NM"].ToString();
                        dgv_item_list.Rows[i].Cells["투입수량"].Value    = dt.Rows[i]["INPUT_AMT"].ToString();
                        dgv_item_list.Rows[i].Cells["불량"].Value      = double.Parse(dt.Rows[i]["POOR_AMT"].ToString()).ToString("#,0");
                        dgv_item_list.Rows[i].Cells["불량율"].Value     = ((double)100 * double.Parse(dt.Rows[i]["POOR_AMT"].ToString()) / double.Parse(dt.Rows[i]["INPUT_AMT"].ToString())).ToString();
                        dgv_item_list.Rows[i].Cells["LOSS율"].Value   = ((double)100 * double.Parse(dt.Rows[i]["LOSS"].ToString()) / double.Parse(dt.Rows[i]["INPUT_AMT"].ToString())).ToString();

                        dgv_item_list.Rows[i].Cells["LOSS"].Value = dt.Rows[i]["LOSS"].ToString();
                        if (dt.Rows[i]["LOT_SUB"].ToString() == "99")
                        {
                            dgv_item_list.Rows[i].Cells["LOT_SUB"].Value     = (string)"합계";
                            dgv_item_list.Rows[i].Cells["LOT_NO"].Value      = (string)"제품";
                            dgv_item_list.Rows[i].DefaultCellStyle.BackColor = Color.WhiteSmoke;
                            dgv_item_list.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
                        }
                    }
                    wConst.mergeCells(dgv_item_list, 1);
                }
                else
                {
                    dgv_item_list.Rows.Clear();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("시스템 에러: " + e.Message.ToString());
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(e.Message + " - " + e.ToString());
                msg.ShowDialog();
            }
        }