Example #1
0
        private bool deletePost()
        {
            bool bRet = false;

            try
            {
                wnDm  wDm  = new wnDm();
                wnAdo wAdo = new wnAdo();

                StringBuilder sb = new StringBuilder();

                sb.AppendLine(" delete from PRODUCT_COLLECT_DEPT ");
                sb.AppendLine(" where COLLECT_DATE = @COLLECT_DATE ");
                sb.AppendLine("     and COLLECT_NUM = @p1 ");

                SqlCommand sCommand = new SqlCommand(sb.ToString());

                sCommand.Parameters.AddWithValue("@COLLECT_DATE", dtp일자.Text);
                sCommand.Parameters.AddWithValue("@p1", lbl번호.Text);

                int qResult = wAdo.SqlCommandEtc(sCommand, "Delete-PRODUCT_COLLECT_DEPT");
                if (qResult > 0)
                {
                    bRet = true;
                }
                else
                {
                    bRet = false;
                }

                if (bRet == true)
                {
                }
                else
                {
                    MessageBox.Show("삭제 중에 오류가 발생했습니다.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("데이터베이스에 문제가 발생했습니다.");
                wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString());
            }
            return(bRet);
        }
Example #2
0
        private void chk_list()
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;

                StringBuilder sb = new StringBuilder();
                sb.AppendLine("where 1=1 ");
                if (!txt_srch.Text.ToString().Equals(""))
                {
                    sb.AppendLine("and CHK_NM like '%" + txt_srch.Text.ToString() + "%' ");
                }

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


                if (dt != null && dt.Rows.Count > 0)
                {
                    lbl_cnt.Text = dt.Rows.Count.ToString();

                    this.dataChkGrid.RowCount = dt.Rows.Count;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dataChkGrid.Rows[i].Cells["CHK_CD"].Value     = dt.Rows[i]["CHK_CD"].ToString();
                        dataChkGrid.Rows[i].Cells["CHK_NM"].Value     = dt.Rows[i]["CHK_NM"].ToString();
                        dataChkGrid.Rows[i].Cells["PASS_VALUE"].Value = dt.Rows[i]["PASS_VALUE"].ToString();
                        dataChkGrid.Rows[i].Cells["CHK_TOOL"].Value   = dt.Rows[i]["CHK_TOOL"].ToString();
                        dataChkGrid.Rows[i].Cells["CHK_TIME"].Value   = dt.Rows[i]["CHK_TIME"].ToString();
                        dataChkGrid.Rows[i].Cells["POOR_CD"].Value    = dt.Rows[i]["POOR_CD"].ToString();
                        dataChkGrid.Rows[i].Cells["POOR_NM"].Value    = dt.Rows[i]["POOR_NM"].ToString();
                    }
                }
                else
                {
                    dataChkGrid.Rows.Clear();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("시스템 오류: " + e.ToString());
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(e.Message + " - " + e.ToString());
                msg.ShowDialog();
            }
        }
        private void btn_raw_srch_Click(object sender, EventArgs e)
        {
            wnDm wDm = new wnDm();

            Popup.pop_sf_제품검색 msg = new Popup.pop_sf_제품검색();
            msg.dt = wDm.fn_Item_List("where 1=1  ");

            msg.ShowDialog();

            if (msg.sCode != null && !msg.sCode.Equals(""))
            {
                txt_srch.Text  = msg.sName;
                txt_srch2.Text = msg.sCode;

                input_item_list();
                inputRmGrid.Rows.Clear();
            }
        }
Example #4
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            wnDm wDm   = new wnDm();
            int  rsNum = wDm.DeleteFacFix(txt_faccd.Text.ToString(), int.Parse(txt_seq.Text.ToString()));

            if (rsNum == 0)
            {
                resetSetting();

                MessageBox.Show("성공적으로 삭제하였습니다.");
            }
            else if (rsNum == 1)
            {
                MessageBox.Show("삭제에 실패하였습니다.");
            }

            resetSetting();
        }
Example #5
0
        public pop원자재검색()
        {
            InitializeComponent();
            wnDm      wndm = new wnDm();
            DataTable dt   = wndm.fn_Raw_Name_List();

            autoSelect = new string[dt.Rows.Count];
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                autoSelect[i] = dt.Rows[i]["RAW_MAT_CD"].ToString();
            }
            var source = new AutoCompleteStringCollection();

            source.AddRange(autoSelect);
            txtSrch.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtSrch.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtSrch.AutoCompleteCustomSource = source;
        }
Example #6
0
        private void bindData(string condition)
        {
            lblSearch.Left    = spCont.Panel2.ClientSize.Width / 2 - lblSearch.Width / 2;
            lblSearch.Top     = spCont.Panel2.ClientSize.Height / 2 - lblSearch.Height / 2;
            lblSearch.Visible = true;
            Application.DoEvents();

            this.GridRecord.DataSource = null;
            this.GridRecord.RowCount   = 0;

            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;
                dt = wDm.fn_PRODUCT_COLLECT_DEPT_List(condition);

                if (dt != null && dt.Rows.Count > 0)
                {
                    this.GridRecord.RowCount = dt.Rows.Count;

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        this.GridRecord.Rows[i].Cells[0].Value  = "";
                        this.GridRecord.Rows[i].Cells[1].Value  = (i + 1).ToString();
                        this.GridRecord.Rows[i].Cells[2].Value  = dt.Rows[i]["COLLECT_DATE"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[3].Value  = dt.Rows[i]["COLLECT_NUM"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[4].Value  = wConst.get_수금구분_명칭(dt.Rows[i]["COLLECT_KIND"].ToString().Trim());
                        this.GridRecord.Rows[i].Cells[5].Value  = dt.Rows[i]["CUST_CODE1"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[6].Value  = dt.Rows[i]["CUST_NAME1"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[7].Value  = decimal.Parse(dt.Rows[i]["COLLECT_AMOUNT"].ToString().Trim()).ToString("#,0");
                        this.GridRecord.Rows[i].Cells[8].Value  = dt.Rows[i]["BILL_NUMBER"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[9].Value  = dt.Rows[i]["COLLECT_LAST2"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[10].Value = dt.Rows[i]["TAX_DATE"].ToString().Trim().Replace("/", "-");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("검색중에 오류가 발생했습니다.");
                wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString());
            }

            lblSearch.Visible = false;
        }
        private void btn_pass_Click(object sender, EventArgs e)
        {
            if (!txt_chk_date.Text.ToString().Equals(""))
            {
                if (txt_check_yn.Text.ToString().Equals("N"))
                {
                    if (cmb_raw_pass.SelectedValue == null)
                    {
                        cmb_raw_pass.SelectedValue = "";
                    }

                    if ((string)cmb_raw_pass.SelectedValue == "")
                    {
                        MessageBox.Show("검사결과를 선택하시기 바랍니다.");
                        return;
                    }

                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.updateRawChkPass(txt_input_date.Text.ToString()
                                                      , txt_input_cd.Text.ToString()
                                                      , txt_seq.Text.ToString()
                                                      , cmb_raw_pass.SelectedValue.ToString()
                                                      , decimal.Parse(final_pass_amt.Text.ToString().Replace(",", "")));
                    if (rsNum == 0)
                    {
                        chk_req_list();
                        chk_complete_list();

                        txt_check_nm.Text = "완료";
                        txt_check_yn.Text = "Y";
                        MessageBox.Show("검사가 완료되었습니다.");
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러2");
                    }
                    tlp_raw.Visible = false;
                }
            }
        }
        private void lotSubGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                DataGridView dgv = (DataGridView)sender;

                wnDm          wDm = new wnDm();
                DataTable     dt  = null;
                StringBuilder sb  = new StringBuilder();
                sb.AppendLine(" and LOT_NO = '" + dgv.Rows[e.RowIndex].Cells[0].Value.ToString() + "' ");

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

                if (dt.Rows.Count > 0)
                {
                    txt_lot_no.Text     = dgv.Rows[e.RowIndex].Cells[0].Value.ToString();
                    txt_sub_no.Text     = dgv.Rows[e.RowIndex].Cells[1].Value.ToString();
                    txt_f_step.Text     = dgv.Rows[e.RowIndex].Cells[2].Value.ToString();
                    txt_flow_nm.Text    = dgv.Rows[e.RowIndex].Cells[3].Value.ToString();
                    txt_f_sub_amt.Text  = dgv.Rows[e.RowIndex].Cells[4].Value.ToString();
                    txt_f_sub_date.Text = dgv.Rows[e.RowIndex].Cells[5].Value.ToString();
                    txt_flow_cd.Text    = dgv.Rows[e.RowIndex].Cells[6].Value.ToString();

                    txt_input_bar.Text = txt_lot_no.Text.ToString() + int.Parse(txt_sub_no.Text.ToString()).ToString("000");
                    txt_lot_bar.Text   = txt_input_bar.Text.ToString();
                    lbl_bar.Text       = txt_input_bar.Text.ToString();
                    dt = wDm.fn_wf_item_srch(txt_lot_no.Text.ToString());

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        txt_item_cd.Text = dt.Rows[0]["ITEM_CD"].ToString();
                        txt_item_nm.Text = dt.Rows[0]["ITEM_NM"].ToString();
                        txt_spec.Text    = dt.Rows[0]["SPEC"].ToString();
                    }

                    lot_sub_grd_logic();
                }
                else
                {
                    MessageBox.Show("작업지시서에 등록된 LOT_NO가 없습니다. ");
                    return;
                }
            }
        }
        private void gridSetting()
        {
            DataGridViewComboBoxColumn cmbColumn = new DataGridViewComboBoxColumn();

            wnDm      wDm = new wnDm();
            DataTable dt  = wDm.fn_query_Type();
            //((DataGridViewComboBoxColumn)dataChkGrid.Columns["GRADE"]).DataSource = dt2;

            int num = dt.Rows.Count;

            cmbColumn.ValueMember   = "코드";
            cmbColumn.DisplayMember = "명칭";
            cmbColumn.DataSource    = dt;
            cmbColumn.HeaderText    = "불량유형";
            cmbColumn.Name          = "POOR_TYPE";

            rawPoorGrid.Columns.Add(cmbColumn);
            rawPoorGrid.Columns[rawPoorGrid.Columns.Count - 1].Width = 100;

            //cmbColumn = new DataGridViewComboBoxColumn();
            ////dt = wDm.fn_query_Poor();
            //cmbColumn.ValueMember = "코드";
            //cmbColumn.DisplayMember = "명칭";
            ////cmbColumn.DataSource = dt;
            //cmbColumn.HeaderText = "불량내역";
            //cmbColumn.Name = "POOR_CD";

            //rawPoorGrid.Columns.Add(cmbColumn);
            rawPoorGrid.Columns.Add("POOR_NM", "불량사유"); //index 1
            rawPoorGrid.Columns[rawPoorGrid.Columns.Count - 1].Width = 120;

            rawPoorGrid.Columns.Add("PRI_NON_PASS_AMT", "부적합량"); //index 2
            rawPoorGrid.Columns.Add("UPD_DETAIL", "수정내역");       //index 3
            rawPoorGrid.Columns.Add("UPD_PASS_AMT", "수정합량");     //index 4
            rawPoorGrid.Columns.Add("COMMENT", "비고");            //index 5
            rawPoorGrid.Columns.Add("POOR_SEQ", "SEQ");          //index 6

            rawPoorGrid.Columns[2].Width   = 60;
            rawPoorGrid.Columns[3].Width   = 150;
            rawPoorGrid.Columns[4].Width   = 60;
            rawPoorGrid.Columns[5].Width   = 110;
            rawPoorGrid.Columns[6].Width   = 50;
            rawPoorGrid.Columns[6].Visible = false;
        }
Example #10
0
        private void estiDetail2()
        {
            wnDm      wDm = new wnDm();
            DataTable dt  = null;

            dt = wDm.fn_Esti_Detail_List("where A.ESTI_DATE = '" + txt_esti_date.Text.ToString() + "' and A.ESTI_CD = '" + txt_esti_cd.Text.ToString() + "' ");

            if (dt != null && dt.Rows.Count > 0)
            {
                itemEstimateGrid.Rows.Clear();


                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    itemEstimateGridAdd();
                    itemEstimateGrid.Rows[i].Cells["SEQ"].Value     = dt.Rows[i]["SEQ"].ToString();
                    itemEstimateGrid.Rows[i].Cells["ITEM_CD"].Value = dt.Rows[i]["ITEM_CD"].ToString();
                    itemEstimateGrid.Rows[i].Cells["ITEM_NM"].Value = dt.Rows[i]["ITEM_NM"].ToString();
                    itemEstimateGrid.Rows[i].Cells["UNIT_CD"].Value = dt.Rows[i]["UNIT_CD"].ToString();
                    itemEstimateGrid.Rows[i].Cells["UNIT_NM"].Value = dt.Rows[i]["UNIT_NM"].ToString();
                    //itemEstimateGrid.Rows[i].Cells["CLASS_CD"].Value = dt.Rows[i]["CLASS_CD"].ToString();
                    //itemEstimateGrid.Rows[i].Cells["CLASS_NM"].Value = dt.Rows[i]["CLASS_NM"].ToString();
                    //itemEstimateGrid.Rows[i].Cells["COUNTRY_CD"].Value = dt.Rows[i]["COUNTRY_CD"].ToString();
                    //itemEstimateGrid.Rows[i].Cells["COUNTRY_NM"].Value = dt.Rows[i]["COUNTRY_NM"].ToString();
                    //itemEstimateGrid.Rows[i].Cells["CHUGJONG_CD"].Value = dt.Rows[i]["CHUGJONG_CD"].ToString();
                    //itemEstimateGrid.Rows[i].Cells["CHUGJONG_NM"].Value = dt.Rows[i]["CHUGJONG_NM"].ToString();
                    itemEstimateGrid.Rows[i].Cells["TYPE_CD"].Value = dt.Rows[i]["TYPE_CD"].ToString();
                    itemEstimateGrid.Rows[i].Cells["TYPE_NM"].Value = dt.Rows[i]["TYPE_NM"].ToString();
                    //itemEstimateGrid.Rows[i].Cells["LABEL_NM"].Value = dt.Rows[i]["LABEL_NM"].ToString();
                    //itemEstimateGrid.Rows[i].Cells["RAW_ITEM_GUBUN"].Value = dt.Rows[i]["RAW_ITEM_GUBUN"].ToString().Equals("1") ? "상품" : "제품";
                    itemEstimateGrid.Rows[i].Cells["VAT_CD"].Value = dt.Rows[i]["VAT_CD"].ToString();


                    itemEstimateGrid.Rows[i].Cells["OUT_AMT"].Value   = (decimal.Parse(dt.Rows[i]["TOTAL_AMT"].ToString())).ToString("#,0.######");
                    itemEstimateGrid.Rows[i].Cells["OUT_PRICE"].Value = (decimal.Parse(dt.Rows[i]["TOTAL_PRICE"].ToString())).ToString("#,0.######");
                    cal_tax(i);
                }
            }
            else
            {
                itemEstimateGrid.RowCount = 0;
                itemEstimateGridAdd(); //데이터가 없을 경우 빈 행 생성
            }
        }
Example #11
0
        private void item_Delete()
        {
            try
            {
                wnDm wDm = new wnDm();

                int rsNum = wDm.DeleteCountryCode(
                    txt_country_cd.Text
                    );


                if (rsNum == 0)
                {
                    resetSetting();
                    item_list();
                    MessageBox.Show("성공적으로 삭제하였습니다.");
                }
                else if (rsNum == 1)
                {
                    MessageBox.Show("삭제에 실패하였습니다");
                }
                else if (rsNum == 2)
                {
                    MessageBox.Show("SQL COMMAND 에러");
                }
                else if (rsNum == 3)
                {
                    MessageBox.Show("기존 코드가 있으니 \n 다른 코드로 입력 바랍니다.");
                }
                else
                {
                    MessageBox.Show("Exception 에러");
                }
            }



            catch (Exception e)
            {
                MessageBox.Show("시스템 에러: " + e.Message.ToString());
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(e.Message + " - " + e.ToString());
                msg.ShowDialog();
            }
        }
Example #12
0
        private void saupSetting()
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = new DataTable();
                dt = wDm.fn_Saup_List(saup_no);

                if (dt != null && dt.Rows.Count > 0)
                {
                    txt_saup_nm.Text    = dt.Rows[0]["COMPANY_NM"].ToString();
                    txt_corporate.Text  = dt.Rows[0]["CORPORATE_NO"].ToString();
                    txt_uptae.Text      = dt.Rows[0]["UPTAE"].ToString();
                    txt_jongmok.Text    = dt.Rows[0]["JONGMOK"].ToString();
                    txt_post_no.Text    = dt.Rows[0]["POST_NO"].ToString();
                    txt_addr.Text       = dt.Rows[0]["ADDR"].ToString();
                    txt_addr2.Text      = dt.Rows[0]["ADDR2"].ToString();
                    txt_open_date.Text  = dt.Rows[0]["OPEN_DATE"].ToString();
                    txt_comp_phone.Text = dt.Rows[0]["COMP_PHONE"].ToString();
                    txt_fax.Text        = dt.Rows[0]["FAX"].ToString();
                    txt_mg_email.Text   = dt.Rows[0]["MANAGER_EMAIL"].ToString();
                    txt_mg_phone.Text   = dt.Rows[0]["MANAGER_PHONE"].ToString();
                    txt_homepage.Text   = dt.Rows[0]["HOMEPAGE"].ToString();

                    if (int.Parse(dt.Rows[0]["LOGO_SIZE"].ToString()) > 0)
                    {
                        byte[]       rs  = (byte[])dt.Rows[0]["SAUP_LOGO"];
                        MemoryStream ms  = new MemoryStream(rs);
                        Image        img = Image.FromStream(ms);

                        Image cus_img = ComInfo.pic_resize_logic(pic_exam, img);

                        pic_exam.BackgroundImage = cus_img;
                    }
                }
                else
                {
                    txt_saup_nm.Text = Common.p_strCompNm;
                }
            }
            catch (Exception e)
            {
            }
        }
Example #13
0
        private void output_list(DataGridView dgv, string condition)
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;
                dt = wDm.fn_등록반품_List(condition);

                if (dt != null && dt.Rows.Count > 0)
                {
                    dgv.RowCount = dt.Rows.Count;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dgv.Rows[i].Cells["R_반품일자"].Value   = dt.Rows[i]["RETURN_DATE"].ToString();
                        dgv.Rows[i].Cells["R_번호"].Value     = dt.Rows[i]["RETURN_NUM"].ToString();
                        dgv.Rows[i].Cells["R_거래처코드"].Value  = dt.Rows[i]["CUST_CD"].ToString();
                        dgv.Rows[i].Cells["R_거래처"].Value    = dt.Rows[i]["CUST_NM"].ToString();
                        dgv.Rows[i].Cells["R_배송일자"].Value   = dt.Rows[i]["DELIVERY_DATE"].ToString();
                        dgv.Rows[i].Cells["R_배송번호"].Value   = dt.Rows[i]["DELIVERY_CD"].ToString();
                        dgv.Rows[i].Cells["R_창고코드"].Value   = dt.Rows[i]["STORAGE_CD"].ToString();
                        dgv.Rows[i].Cells["R_창고"].Value     = dt.Rows[i]["STORAGE_NM"].ToString();
                        dgv.Rows[i].Cells["R_비고"].Value     = dt.Rows[i]["COMMENT"].ToString();
                        dgv.Rows[i].Cells["R_담당사원코드"].Value = dt.Rows[i]["STAFF_CD"].ToString();

                        dgv.Rows[i].Cells["R_회수사원"].Value   = dt.Rows[i]["RECALL_STAFF"].ToString();
                        dgv.Rows[i].Cells["R_회수일자"].Value   = dt.Rows[i]["RECALL_DATE"].ToString();
                        dgv.Rows[i].Cells["R_완료사원"].Value   = dt.Rows[i]["COMPLETE_STAFF"].ToString();
                        dgv.Rows[i].Cells["R_완료일자"].Value   = dt.Rows[i]["COMPLETE_DATE"].ToString();
                        dgv.Rows[i].Cells["R_전표상태코드"].Value = dt.Rows[i]["SALE_STATE"].ToString();
                        dgv.Rows[i].Cells["R_상태변경일자"].Value = dt.Rows[i]["STATE_DATE"].ToString();
                        dgv.Rows[i].Cells["R_전표상태"].Value   = dt.Rows[i]["S_CODE_NM"].ToString();
                        //dgv.Rows[i].Cells[4].Value = dt.Rows[i]["COMPLETE_YN"].ToString();
                    }
                }
                else
                {
                    dgv.Rows.Clear();
                }
            }
            catch (Exception e)
            {
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(e.Message + " - " + e.ToString()); msg.ShowDialog();
            }
        }
Example #14
0
        private void grid_CellEndEdit(object sender, DataGridViewCellEventArgs e)  //원재료 검색
        {
            conDataGridView  grd  = (conDataGridView)sender;
            DataGridViewCell cell = grd[e.ColumnIndex, e.RowIndex];

            cell.Style.BackColor = Color.White;

            #region 공통 그리드 체크
            if (grd.Columns[e.ColumnIndex].ToolTipText.IndexOf("명칭") >= 0 && grd._KeyInput == "enter")
            {
                string    rat_mat_nm = (string)grd.Rows[e.RowIndex].Cells["RAW_MAT_NM"].Value;
                wnDm      wDm        = new wnDm();
                DataTable dt         = new DataTable();
                dt = wDm.fn_Raw_List("where RAW_MAT_NM like '%" + rat_mat_nm + "%' ");

                if (dt.Rows.Count > 1)
                { //row가 2줄이 넘을 경우 팝업으로 넘어간다.
                    Console.WriteLine("popup");
                    wConst.call_pop_raw_mat(grd, dt, e.RowIndex, rat_mat_nm, 1);
                    //itemCompGridAdd();
                }
                else if (dt.Rows.Count == 1) //row가 1일 경우 해당 row에 값을 자동 입력한다.
                {
                    grd.Rows[e.RowIndex].Cells["RAW_MAT_CD"].Value     = dt.Rows[0]["RAW_MAT_CD"].ToString();
                    grd.Rows[e.RowIndex].Cells["RAW_MAT_NM"].Value     = dt.Rows[0]["RAW_MAT_NM"].ToString();
                    grd.Rows[e.RowIndex].Cells["OLD_RAW_MAT_NM"].Value = dt.Rows[0]["RAW_MAT_NM"].ToString(); //백업 키워드
                    grd.Rows[e.RowIndex].Cells["SPEC"].Value           = dt.Rows[0]["SPEC"].ToString();
                    grd.Rows[e.RowIndex].Cells["IN_UNIT"].Value        = dt.Rows[0]["INPUT_UNIT"].ToString();
                    grd.Rows[e.RowIndex].Cells["OUT_UNIT"].Value       = dt.Rows[0]["OUTPUT_UNIT"].ToString();
                    grd.Rows[e.RowIndex].Cells["IN_UNIT_NM"].Value     = dt.Rows[0]["INPUT_UNIT_NM"].ToString();
                    grd.Rows[e.RowIndex].Cells["OUT_UNIT_NM"].Value    = dt.Rows[0]["OUTPUT_UNIT_NM"].ToString();
                    grd.Rows[e.RowIndex].Cells["TOTAL_AMT"].Value      = "0";

                    itemCompGridAdd();
                }
                else
                { //row가 없는 경우
                    MessageBox.Show("데이터가 없습니다.");
                }
            }
            #endregion 공통 그리드 체크

            //string sSearchTxt = "" + (string)grd.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
        }
        //버튼 출력 관련
        private void grid_CellContent(object sender, DataGridViewCellEventArgs e)
        {
            conDataGridView grd = (conDataGridView)sender;

            if (grd.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
            {
                if (((DataGridViewButtonColumn)grd.Columns["O_BTN_OUT"]).ReadOnly == true)
                {
                    MessageBox.Show("자체 출고로 인해 출하 불가");
                }
                else
                {
                    if ((string)grd.Rows[e.RowIndex].Cells["OUT_INST_YN"].Value != "Y")                                                                     //출하 지시 내리지 않았을 경우
                    {
                        if ((string)grd.Rows[e.RowIndex].Cells["O_INPUT_DATE"].Value != "" && (string)grd.Rows[e.RowIndex].Cells["O_INPUT_CD"].Value != "") //출고 번호가 있을 경우에만 출하지시 등록
                        {
                            wnDm wDm   = new wnDm();
                            int  rsNum = wDm.insertItemOutInst(
                                txt_out_date.Text.ToString(),
                                txt_out_cd.Text.ToString(),
                                (string)itemOutGrid.Rows[e.RowIndex].Cells["SEQ"].Value);

                            if (rsNum == 0)
                            {
                                itemOutGrid.Rows[e.RowIndex].Cells["O_BTN_OUT"].Value   = "완료";
                                itemOutGrid.Rows[e.RowIndex].Cells["OUT_INST_YN"].Value = "Y";
                                output_list(tdOutGrid, "where convert(varchar(10), A.INTIME, 120) = convert(varchar(10), getDate(), 120) ", "");
                                output_list(outputGrid, "where A.OUTPUT_DATE >= '" + txt_start_date.Text.ToString() + "' and  A.OUTPUT_DATE <= '" + txt_end_date.Text.ToString() + "'", "");

                                MessageBox.Show("출하지시 완료 하였습니다.");
                            }
                        }
                        else
                        {
                            MessageBox.Show("출고번호가 없어 등록이 불가능합니다.");
                        }
                    }
                    else
                    {
                        MessageBox.Show("출고 이미 완료");
                    }
                }
            }
        }
        private void facGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;

                string condition = "where FAC_CD = '" + facGrid.Rows[e.RowIndex].Cells[0].Value.ToString() + "'";

                dt      = wDm.fn_Fac_List(condition);
                this.dt = dt;

                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Example #17
0
        private void get_Man_Info(string sCode)
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;
                dt = wDm.fn_User_Detail(sCode);

                if (dt != null && dt.Rows.Count > 0)
                {
                    txt부서코드.Text = dt.Rows[0]["USER_DEPT"].ToString().Trim();
                    txt부서명.Text  = dt.Rows[0]["CODE_DESC"].ToString().Trim();
                }
            }
            catch (Exception ex) {
                wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString()); Popup.pop오류리포트 msg = new Popup.pop오류리포트(ex.Message + " - " + ex.ToString());
                msg.ShowDialog();
            }
        }
        private void bindData(string condition)
        {
            lblSearch.Left    = this.ClientSize.Width / 2 - lblSearch.Width / 2;
            lblSearch.Top     = this.ClientSize.Height / 2 - lblSearch.Height / 2;
            lblSearch.Visible = true;
            Application.DoEvents();

            this.GridRecord.DataSource = null;
            this.GridRecord.RowCount   = 0;

            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;
                dt = wDm.fn_User_List(condition);

                if (dt != null && dt.Rows.Count > 0)
                {
                    this.GridRecord.RowCount = dt.Rows.Count;

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        this.GridRecord.Rows[i].Cells[0].Value = dt.Rows[i]["USER_CODE"].ToString();
                        this.GridRecord.Rows[i].Cells[1].Value = dt.Rows[i]["USER_NAME"].ToString();
                        this.GridRecord.Rows[i].Cells[2].Value = dt.Rows[i]["USER_RESNUM"].ToString();
                        this.GridRecord.Rows[i].Cells[3].Value = dt.Rows[i]["USER_SELECT_NM"].ToString();
                        this.GridRecord.Rows[i].Cells[4].Value = dt.Rows[i]["USER_MAN_NM"].ToString();
                        this.GridRecord.Rows[i].Cells[5].Value = dt.Rows[i]["USER_ID"].ToString();
                        this.GridRecord.Rows[i].Cells[6].Value = dt.Rows[i]["USER_PASS"].ToString();
                        this.GridRecord.Rows[i].Cells[7].Value = dt.Rows[i]["USER_DEPT_NM"].ToString();
                        this.GridRecord.Rows[i].Cells[8].Value = (dt.Rows[i]["USER_SERVER1"].ToString() == "1" ? "o" : "");
                        this.GridRecord.Rows[i].Cells[9].Value = (dt.Rows[i]["USER_SERVER2"].ToString() == "1" ? "o" : "");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("검색중에 오류가 발생했습니다.");
                wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString());
            }

            lblSearch.Visible = false;
        }
Example #19
0
        private void inputLogic()
        {
            if (txt_w.Text.ToString().Equals(""))
            {
                MessageBox.Show("잔재의 가로를 입력해주세요.");
                return;
            }
            if (txt_h.Text.ToString().Equals(""))
            {
                MessageBox.Show("잔재의 세로를 입력해주세요.");
                return;
            }

            string spec = txt_t.Text + "*" + txt_w.Text.Replace(",", "") + "*" + txt_h.Text.Replace(",", "");


            wnDm wDm = new wnDm();


            int rsNum = wDm.insertRawInput(spec);


            if (rsNum == 0)
            {
                MessageBox.Show("성공적으로 등록하였습니다.");
            }
            else if (rsNum == 1)
            {
                MessageBox.Show("저장에 실패하였습니다");
            }
            else if (rsNum == 2)
            {
                MessageBox.Show("조건 검사 중 에러");
            }
            else if (rsNum == 3)
            {
                MessageBox.Show("발주수량보다 초과 입력 하셨습니다. \n 확인 후 다시 저장 하시기 바랍니다.");
            }
            else
            {
                MessageBox.Show("Exception 에러");
            }
        }
        private void btnSearch_Click(object sender, EventArgs e)
        {
            gubun = cmb_option.SelectedIndex;

            wnDm          wDm = new wnDm();
            DataTable     dt  = new DataTable();
            StringBuilder sb  = new StringBuilder();

            sb.AppendLine(" WHERE ((A.RAW_MAT_CD like '%" + txtSrch.Text.ToString() + "%') OR (A.RAW_MAT_NM like '%" + txtSrch.Text.ToString() + "%') OR (A.SPEC like '%" + txtSrch.Text.ToString() + "%'))");
            sb.AppendLine("and A.RAW_MAT_GUBUN like '%" + cbo자재구분.SelectedValue + "%'");

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

            raw_list_rs(dt);


            Properties.Settings.Default.rawSelect = gubun;
            Properties.Settings.Default.Save();
        }
        private void chk_logic()
        {
            try
            {
                wnDm          wDm = new wnDm();
                DataTable     dt  = null;
                StringBuilder sb  = new StringBuilder();
                if (!txt_srch.Text.ToString().Equals(""))
                {
                    sb.AppendLine(" and A.RAW_MAT_NM like '%" + txt_srch.Text.ToString() + "%' ");
                }
                dt = wDm.fn_Raw_Chk_List(sb.ToString());

                raw_chk_list(rawGrid, dt);
            }
            catch (Exception e)
            {
            }
        }
Example #22
0
        /// <summary>
        /// bin시정개선조치() - S_이슈등록 바인딩함
        /// </summary>
        private void bind시정개선조치(string condition)
        {
            dgv이슈.Rows.Clear();
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;
                dt = wDm.fn_이슈등록리스트(condition);

                if (dt != null && dt.Rows.Count > 0)
                {
                    dgv이슈.RowCount = dt.Rows.Count;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dgv이슈.Rows[i].Cells["ISSUE_DATE"].Value = dt.Rows[i]["ISSUE_DATE"].ToString();
                        dgv이슈.Rows[i].Cells["ISSUE_NUM"].Value  = dt.Rows[i]["ISSUE_NUM"].ToString();
                        dgv이슈.Rows[i].Cells["CUST_CD"].Value    = dt.Rows[i]["CUST_CD"].ToString();
                        dgv이슈.Rows[i].Cells["CUST_NM"].Value    = dt.Rows[i]["CUST_NM"].ToString();
                        //  dgv이슈.Rows[i].Cells["STAFF_CD"].Value = dt.Rows[i]["STAFF_CD"].ToString();
                        //  dgv이슈.Rows[i].Cells["STAFF_NM"].Value = dt.Rows[i]["STAFF_NM"].ToString();
                        dgv이슈.Rows[i].Cells["ISSUE_STAFF_CD"].Value = dt.Rows[i]["ISSUE_STAFF_CD"].ToString();
                        dgv이슈.Rows[i].Cells["ISSUE_STAFF_NM"].Value = dt.Rows[i]["ISSUE_STAFF_NM"].ToString();
                        dgv이슈.Rows[i].Cells["ISSUE_CD"].Value       = dt.Rows[i]["ISSUE_CD"].ToString();
                        dgv이슈.Rows[i].Cells["ISSUE_MEMO"].Value     = dt.Rows[i]["ISSUE_COMPLETE_MEMO"].ToString();
                        // dgv이슈.Rows[i].Cells["COMMENT"].Value = dt.Rows[i]["COMMENT"].ToString();
                        dgv이슈.Rows[i].Cells["STATE_DATE"].Value = dt.Rows[i]["STATE_DATE"].ToString();
                        dgv이슈.Rows[i].Cells["TEL_NO"].Value     = dt.Rows[i]["TEL_NO"].ToString();
                        dgv이슈.Rows[i].Cells["O_ORD_DATE"].Value = dt.Rows[i]["ORD_DATE"].ToString();
                        dgv이슈.Rows[i].Cells["O_ORD_NUM"].Value  = dt.Rows[i]["ORD_NUM"].ToString();
                        dgv이슈.Rows[i].Cells["ISSUE_NM"].Value   = dt.Rows[i]["ISSUE_NM"].ToString() + "완료";
                        //dgv.Rows[i].Cells[4].Value = dt.Rows[i]["COMPLETE_YN"].ToString();
                    }
                }
                else
                {
                    dgv이슈.Rows.Clear();
                }
            }
            catch (Exception e)
            {
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(e.Message + " - " + e.ToString()); msg.ShowDialog();
            }
        }
        private void item_flow_list()
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;

                StringBuilder sb = new StringBuilder();
                sb.AppendLine("where 1=1 ");

                if (cmb_srch_gbn.SelectedIndex > 0)
                {
                    sb.AppendLine("and ITEM_GUBUN = '" + cmb_srch_gbn.SelectedValue.ToString() + "' ");
                }

                if (!txt_srch.Text.ToString().Equals(""))
                {
                    sb.AppendLine("and ITEM_NM like '%" + txt_srch.Text.ToString() + "%' ");
                }

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

                if (dt != null && dt.Rows.Count > 0)
                {
                    this.dataItemGrid.RowCount = dt.Rows.Count;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dataItemGrid.Rows[i].Cells["ITEM_CD"].Value = dt.Rows[i]["ITEM_CD"].ToString();
                        dataItemGrid.Rows[i].Cells["ITEM_NM"].Value = dt.Rows[i]["ITEM_NM"].ToString();
                        //dataItemGrid.Rows[i].Cells[3].Value = dt.Rows[i]["SPEC"].ToString();
                        dataItemGrid.Rows[i].Cells["ITEM_GUBUN_NM"].Value = dt.Rows[i]["ITEM_GUBUN_NM"].ToString();
                    }
                }
                else
                {
                    dataItemGrid.Rows.Clear();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("시스템 에러: " + e.Message.ToString());
            }
        }
Example #24
0
        public void get_Comp_Info()
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;
                dt = wDm.fn_업체정보_Detail(Common.p_strConn);

                if (dt != null && dt.Rows.Count > 0)
                {
                    this.Text   = this.Text + " - " + dt.Rows[0]["상호명"].ToString();
                    lbl업체명.Text = dt.Rows[0]["상호명"].ToString();
                }
            }
            catch (Exception ex)
            {
                wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString());
            }
        }
Example #25
0
 private void txt_srch_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         try
         {
             wnDm      wDm = new wnDm();
             DataTable dt  = null;
             if (chk_stock.Checked == true)
             {
                 dt = wDm.fn_Item_Stock_List("where ( A.ITEM_NM LIKE '%" + txt_srch.Text.ToString() + "%' OR A.LABEL_NM LIKE '%" + txt_srch.Text.ToString() + "%' )  and (ISNULL(B.INPUT_AMT,0) - ISNULL(C.OUTPUT_AMT,0) > 0) ");
             }
             else
             {
                 dt = wDm.fn_Item_Stock_List("where ( A.ITEM_NM LIKE '%" + txt_srch.Text.ToString() + "%' OR A.LABEL_NM LIKE '%" + txt_srch.Text.ToString() + "%' ) ");
             }
             this.dataItemGrid.RowCount = dt.Rows.Count;
             if (dt != null && dt.Rows.Count > 0)
             {
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                     dataItemGrid.Rows[i].Cells["ITEM_CD"].Value     = dt.Rows[i]["ITEM_CD"].ToString();
                     dataItemGrid.Rows[i].Cells["ITEM_NM"].Value     = dt.Rows[i]["ITEM_NM"].ToString();
                     dataItemGrid.Rows[i].Cells["BAL_STOCK"].Value   = decimal.Parse(dt.Rows[i]["BAL_STOCK"].ToString()).ToString("#,0.######");
                     dataItemGrid.Rows[i].Cells["INPUT_AMT"].Value   = decimal.Parse(dt.Rows[i]["INPUT_AMT"].ToString()).ToString("#,0.######");
                     dataItemGrid.Rows[i].Cells["OUTPUT_AMT"].Value  = decimal.Parse(dt.Rows[i]["OUTPUT_AMT"].ToString()).ToString("#,0.######");
                     dataItemGrid.Rows[i].Cells["CHUGJONG_NM"].Value = dt.Rows[i]["CHUGJONG_NM"].ToString();
                     dataItemGrid.Rows[i].Cells["COUNTRY_NM"].Value  = dt.Rows[i]["COUNTRY_NM"].ToString();
                     dataItemGrid.Rows[i].Cells["CLASS_NM"].Value    = dt.Rows[i]["CLASS_NM"].ToString();
                     dataItemGrid.Rows[i].Cells["LABEL_NM"].Value    = dt.Rows[i]["LABEL_NM"].ToString();
                 }
             }
             else
             {
                 dataItemGrid.Rows.Clear();
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("시스템 오류" + ex.ToString());
         }
     }
 }
        private void workGrid_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex > -1)
            {
                DataGridView dgv = (DataGridView)sender;

                wnDm          wDm = new wnDm();
                DataTable     dt  = null;
                StringBuilder sb  = new StringBuilder();
                sb.AppendLine(" and LOT_NO = '" + dgv.Rows[e.RowIndex].Cells["LOT_NO"].Value.ToString() + "' ");
                dt = wDm.fn_Work_Flow_Cnt(sb.ToString());

                lotSubGrid.Rows.Clear();

                lotSubLogic(dgv, e.RowIndex); //lotSubGrid 세팅

                lotSubLogicMain(dt, sb, dgv.Rows[e.RowIndex].Cells["LOT_NO"].Value.ToString());
            }
        }
        private void fn_insert_list(string condition)
        {
            try
            {
                HaccpGrid1.Rows.Clear();
                HaccpGrid2.Rows.Clear();
                HaccpGrid3.Rows.Clear();
                wnDm         wDm     = new wnDm();
                DataTable    dt      = wDm.select_Haccp_Docs(condition);
                DataGridView dgvTemp = null;

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dgvTemp = selectDgv(int.Parse(dt.Rows[i]["DOC_GUBUN"].ToString()));
                    if (dgvTemp != null)
                    {
                        dgvTemp.Rows.Add();
                        dgvTemp.Rows[dgvTemp.RowCount - 1].Cells[0].Value = dt.Rows[i]["INPUT_DATE"].ToString();
                        dgvTemp.Rows[dgvTemp.RowCount - 1].Cells[1].Value = dt.Rows[i]["STAFF_NM"].ToString();
                        dgvTemp.Rows[dgvTemp.RowCount - 1].Cells[2].Value = dt.Rows[i]["COMMENT"].ToString();
                        dgvTemp.Rows[dgvTemp.RowCount - 1].Cells[3].Value = dt.Rows[i]["FNAME"].ToString();
                        dgvTemp.Rows[dgvTemp.RowCount - 1].Cells[5].Value = dt.Rows[i]["INPUT_CD"].ToString();
                        if (!System.IO.File.Exists(dt.Rows[i]["DOCPATH"].ToString()))
                        {
                            dgvTemp.Rows[dgvTemp.RowCount - 1].DefaultCellStyle.BackColor = Color.Red;
                            dgvTemp.Rows[dgvTemp.RowCount - 1].DefaultCellStyle.ForeColor = Color.White;
                            dgvTemp.Rows[dgvTemp.RowCount - 1].Cells[3].Value            += "(MISSING)";
                        }
                        dgvTemp.Rows[dgvTemp.RowCount - 1].Cells[4].Value = dt.Rows[i]["DOCPATH"].ToString();
                    }
                    else
                    {
                        MessageBox.Show("DB정보 오류발생 : 유형구분 값이 비정상적입니다");
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("시스템오류발생");
                MessageBox.Show(ex.ToString());
            }
        }
Example #28
0
        private void collectGrid_Cust_Select(string txt_cust_cd)
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = new DataTable();
                dt = wDm.fn_Give_list("where A.CUST_CD = '" + txt_cust_cd + "'   ");

                if (dt != null && dt.Rows.Count > 0)
                {
                    collectGrid.RowCount = dt.Rows.Count;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        collectGrid.Rows[i].Cells["NO"].Value           = dt.Rows.Count - i;
                        collectGrid.Rows[i].Cells["COLLECT_DATE"].Value = dt.Rows[i]["GIVE_DATE"].ToString();
                        collectGrid.Rows[i].Cells["COLLECT_CD"].Value   = dt.Rows[i]["GIVE_CD"].ToString();
                        collectGrid.Rows[i].Cells["SOO_GUBUN_CD"].Value = dt.Rows[i]["GIVE_GUBUN"].ToString();
                        collectGrid.Rows[i].Cells["SOO_GUBUN_NM"].Value = dt.Rows[i]["GIVE_GUBUN_NM"].ToString();
                        collectGrid.Rows[i].Cells["CUST_CD"].Value      = dt.Rows[i]["CUST_CD"].ToString();
                        collectGrid.Rows[i].Cells["CUST_NM"].Value      = dt.Rows[i]["CUST_NM"].ToString();
                        collectGrid.Rows[i].Cells["SOO_MONEY"].Value    = decimal.Parse(dt.Rows[i]["GIVE_MONEY"].ToString()).ToString("#,0.######");
                        collectGrid.Rows[i].Cells["DC_MONEY"].Value     = decimal.Parse(dt.Rows[i]["DC_MONEY"].ToString()).ToString("#,0.######");
                        collectGrid.Rows[i].Cells["TOTAL_MONEY"].Value  = decimal.Parse(dt.Rows[i]["TOTAL_MONEY"].ToString()).ToString("#,0.######");
                        collectGrid.Rows[i].Cells["COMMENT"].Value      = dt.Rows[i]["COMMENT"].ToString();
                    }
                }
                else
                {
                    collectGrid.Rows.Clear();
                }

                txt_soo.ReadOnly         = false;
                txt_dc.ReadOnly          = false;
                txt_total_money.ReadOnly = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show("시스템 오류" + ex.ToString());
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(ex.Message + " - " + ex.ToString());
                msg.ShowDialog();
            }
        }
Example #29
0
        private void input_raw_list()
        {
            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = wDm.fn_Raw_Stock_List(DateTime.Today.ToString("yyyy-MM-dd"), " WHERE 1=1 AND A.RAW_MAT_CD = '" + txt_srch2.Text.ToString() + "'  ");
                adoPrt2 = dt.Copy();

                if (dt != null && dt.Rows.Count > 0)
                {
                    txt_raw_cd.Text  = dt.Rows[0]["원자재코드"].ToString();
                    txt_raw_nm.Text  = dt.Rows[0]["원자재명"].ToString();
                    txt_Cust_Nm.Text = dt.Rows[0]["CUST_NM"].ToString();
                    txt_Spec.Text    = dt.Rows[0]["규격"].ToString();
                    if (dt.Rows[0]["RAW_MAT_GUBUN"].ToString().Equals("1"))
                    {
                        txt_raw_gubun.Text = "원자재";
                    }
                    else
                    {
                        txt_raw_gubun.Text = "부자재";
                    }
                    if (dt.Rows[0]["CHECK_GUBUN"].ToString().Equals("1"))
                    {
                        txt_Check_Yn.Text = "검사";
                    }
                    else
                    {
                        txt_Check_Yn.Text = "생략";
                    }
                    txt_balstock.Text = decimal.Parse(dt.Rows[0]["재고량"].ToString()).ToString("#,0.######");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                MessageBox.Show("원자재 검색 중 오류가 발생했습니다.");
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(ex.Message + " - " + ex.ToString());
                msg.ShowDialog();
                return;
            }
        }
Example #30
0
        private void MetalLoad()
        {
            btnDelete.Enabled = false;


            try
            {
                wnDm      wDm = new wnDm();
                DataTable dt  = null;
                dt = wDm.Fac_Grid_List();

                this.dgvMetalList.RowCount = dt.Rows.Count;
                if (dt != null && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dgvMetalList.Rows[i].Cells["FAC_CD"].Value        = dt.Rows[i]["FAC_CD"].ToString();
                        dgvMetalList.Rows[i].Cells["FAC_NM"].Value        = dt.Rows[i]["FAC_NM"].ToString();
                        dgvMetalList.Rows[i].Cells["MODEL_NM"].Value      = dt.Rows[i]["MODEL_NM"].ToString();
                        dgvMetalList.Rows[i].Cells["SPEC"].Value          = dt.Rows[i]["SPEC"].ToString();
                        dgvMetalList.Rows[i].Cells["MANU_COMPANY"].Value  = dt.Rows[i]["MANU_COMPANY"].ToString();
                        dgvMetalList.Rows[i].Cells["ACQ_PRICE"].Value     = dt.Rows[i]["ACQ_PRICE"].ToString();
                        dgvMetalList.Rows[i].Cells["ACQ_DATE"].Value      = dt.Rows[i]["ACQ_DATE"].ToString();
                        dgvMetalList.Rows[i].Cells["PRO_CAPA"].Value      = dt.Rows[i]["PRODUCE_AMT"].ToString();
                        dgvMetalList.Rows[i].Cells["MAINTEN_CLASS"].Value = dt.Rows[i]["MAINTEN_CLASS"].ToString();
                        dgvMetalList.Rows[i].Cells["COMMENT"].Value       = dt.Rows[i]["COMMENT"].ToString();
                        dgvMetalList.Rows[i].Cells["CHECK_CYCLE"].Value   = dt.Rows[i]["CHECK_CYCLE"].ToString();
                        dgvMetalList.Rows[i].Cells["POWER_NUMBER"].Value  = dt.Rows[i]["POWER_NUMBER"].ToString();
                        dgvMetalList.Rows[i].Cells["AMOUNT"].Value        = dt.Rows[i]["AMOUNT"].ToString();

                        dgvMetalList.Rows[i].Cells["PRODUCE_AMT"].Value = dt.Rows[i]["PRODUCE_AMT"].ToString();
                    }
                }
                else
                {
                    dgvMetalList.Rows.Clear();
                }
            }
            catch (Exception ex)
            {
            }
        }