Beispiel #1
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_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]["SETTLE_DATE"].ToString().Trim().Replace("/", "-");
                        if (dt.Rows[i]["SETTLE_DATE"].ToString().Trim().Replace("/", "-") == "0000-00-00")
                        {
                            this.GridRecord.Rows[i].Cells[9].Value = "";
                        }

                        this.GridRecord.Rows[i].Cells[9].Value = dt.Rows[i]["MEMO"].ToString().Trim();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("검색중에 오류가 발생했습니다.");
                wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString());
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(ex.Message + " - " + ex.ToString());
                msg.ShowDialog();
            }

            lblSearch.Visible = false;
        }
Beispiel #2
0
        private void bindData(string condition)
        {
            lblSearch.Left    = this.ClientSize.Width / 2 - lblSearch.Width / 2;
            lblSearch.Top     = this.ClientSize.Height / 2 - lblSearch.Height / 2;
            lblSearch.Text    = "Searching...";
            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 = (i + 1).ToString();
                        this.GridRecord.Rows[i].Cells[1].Value = dt.Rows[i]["COLLECT_DATE"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[2].Value = dt.Rows[i]["COLLECT_NUM"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[3].Value = wConst.get_수금구분_명칭(dt.Rows[i]["COLLECT_KIND"].ToString().Trim());
                        this.GridRecord.Rows[i].Cells[4].Value = dt.Rows[i]["CUST_CODE1"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[5].Value = dt.Rows[i]["CUST_NAME1"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[6].Value = dt.Rows[i]["REP_NAME1"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[7].Value = dt.Rows[i]["COMP_NUM1"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[8].Value = dt.Rows[i]["MAN_NAME1"].ToString().Trim();
                        this.GridRecord.Rows[i].Cells[9].Value = decimal.Parse(dt.Rows[i]["COLLECT_AMOUNT"].ToString().Trim()).ToString("#,0");

                        if (dt.Rows[i]["COLLECT_LAST"].ToString().Trim() == "1")
                        {
                            this.GridRecord.Rows[i].Cells[10].Value = true;
                        }
                        else
                        {
                            this.GridRecord.Rows[i].Cells[10].Value = false;
                        }

                        this.GridRecord.Rows[i].Cells[11].Value = dt.Rows[i]["TAX_DATE"].ToString().Trim();

                        if (dt.Rows[i]["KIND_AB"].ToString().Trim() == "1")
                        {
                            this.GridRecord.Rows[i].Cells[12].Value = "B수금";
                        }
                        else
                        {
                            this.GridRecord.Rows[i].Cells[12].Value = "A수금";
                        }

                        this.GridRecord.Rows[i].Cells[13].Value = dt.Rows[i]["COLLECT_KIND"].ToString().Trim();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("검색중에 오류가 발생했습니다.");
                wnLog.writeLog(wnLog.LOG_ERROR, ex.Message + " - " + ex.ToString());
            }

            lblSearch.Visible = false;
        }