Beispiel #1
0
        private void btn_cust_search_Click(object sender, EventArgs e)
        {
            Popup.pop거래처검색영업관리 frm = new Popup.pop거래처검색영업관리();

            frm.sCustGbn = "1";
            frm.sCustNm  = txt_cust_nm.Text.ToString();
            frm.ShowDialog();

            if (frm.sCode != "")
            {
                txt_cust_cd.Text = frm.sCode.Trim();
                txt_cust_nm.Text = frm.sName.Trim();
                txt_balance.Text = frm.sBalance.Trim();
            }


            frm.Dispose();
            frm = null;

            try
            {
                스마트팩토리.Model.Query.scQuery sc = new 스마트팩토리.Model.Query.scQuery();
                DataTable dt = new DataTable();
                // dt = sc.selectSalesList(txt_cust_cd.Text.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show("시스템 오류" + ex.ToString());
            }
        }
Beispiel #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (!ck)
            {
                int rsNum = new 스마트팩토리.Model.Query.scQuery().deleteSoo(
                    dtp_date_soo.Text.ToString()
                    , lbl_cd.Text.ToString()
                    , txt_cust_cd.Text.ToString()
                    , txt_total_amt_Temp.Text.ToString()
                    , txt_soo_temp.Text.ToString()
                    , txt_dc_temp.Text.ToString()
                    );
                if (rsNum == 0)
                {
                    reSetting();
                    MessageBox.Show("성공적으로 삭제하였습니다.");
                }
                else if (rsNum == 1)
                {
                    MessageBox.Show("삭제에 실패하였습니다");
                }
                else
                {
                    MessageBox.Show("Exception 에러");
                }
            }
            grd_soo.Rows.Clear();
            grdSooLoad();

            reSetting();
        }
Beispiel #3
0
        private void grd_soo_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            //reSetting();

            try
            {
                txt_balance.Text = decimal.Parse(grd_soo.Rows[e.RowIndex].Cells["BALANCE"].Value.ToString()).ToString("#,0.######");
                txt_cust_cd.Text = grd_soo.Rows[e.RowIndex].Cells["CUST_CD_SOO"].Value.ToString();
                스마트팩토리.Model.Query.scQuery sc = new 스마트팩토리.Model.Query.scQuery();
                collectGrid_Cust_Select(grd_soo.Rows[e.RowIndex].Cells["CUST_CD_SOO"].Value.ToString());

                for (int i = 0; i < collectGrid.Rows.Count; i++)
                {
                    if (collectGrid.Rows[i].Cells["COLLECT_DATE"].Value.ToString().Equals(grd_soo.Rows[e.RowIndex].Cells["SOO_DATE"].Value.ToString()) &&
                        collectGrid.Rows[i].Cells["COLLECT_CD"].Value.ToString().Equals(grd_soo.Rows[e.RowIndex].Cells["SOO_CD"].Value.ToString()))
                    {
                        collectGrid_SelectRow(i);
                        collectGrid.Rows[i].Selected = true;
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("시스템 오류" + ex.ToString());
            }
        }
Beispiel #4
0
        private void grdSooLoad()
        {
            try
            {
                스마트팩토리.Model.Query.scQuery sc = new 스마트팩토리.Model.Query.scQuery();
                DataTable dt = new DataTable();
                dt = sc.selectSooList(txt_cust_cd.Text.ToString());

                if (dt != null && dt.Rows.Count > 0)
                {
                    grd_soo.RowCount = dt.Rows.Count;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        grd_soo.Rows[i].Cells["SOO_DATE"].Value        = dt.Rows[i]["SOO_DATE"].ToString();
                        grd_soo.Rows[i].Cells["SOO_CD"].Value          = dt.Rows[i]["SOO_CD"].ToString();
                        grd_soo.Rows[i].Cells["CUST_NM_SOO"].Value     = dt.Rows[i]["CUST_NM"].ToString();
                        grd_soo.Rows[i].Cells["CUST_CD_SOO"].Value     = dt.Rows[i]["CUST_CD"].ToString();
                        grd_soo.Rows[i].Cells["TOTAL_MONEY_SOO"].Value = (decimal.Parse(dt.Rows[i]["TOTAL_MONEY"].ToString())).ToString("#,0.######");
                        grd_soo.Rows[i].Cells["SOO_GUBUN"].Value       = dt.Rows[i]["SOO_GUBUN"].ToString();
                        grd_soo.Rows[i].Cells["BALANCE"].Value         = dt.Rows[i]["BALANCE"].ToString();
                    }
                }
                else
                {
                    grd_soo.Rows.Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("시스템 오류" + ex.ToString());
            }
        }
Beispiel #5
0
        private void frm수금등록_Load(object sender, EventArgs e)
        {
            string sqlQuery = "";

            //납품처리방법
            cmb_gubun.ValueMember   = "코드";
            cmb_gubun.DisplayMember = "명칭";
            sqlQuery = new 스마트팩토리.Model.Query.scQuery().queryTSCode("910");
            wConst.ComboBox_Read_NoBlank(cmb_gubun, sqlQuery);


            grdSooLoad();

            ComInfo.gridHeaderSet(grd_soo);
            ComInfo.gridHeaderSet(collectGrid);
        }
Beispiel #6
0
        private void collectGrid_Cust_Select(string txt_cust_cd)
        {
            try
            {
                스마트팩토리.Model.Query.scQuery sc = new 스마트팩토리.Model.Query.scQuery();
                DataTable dt = new DataTable();
                dt = sc.fn_Collect_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]["SOO_DATE"].ToString();
                        collectGrid.Rows[i].Cells["COLLECT_CD"].Value   = dt.Rows[i]["SOO_CD"].ToString();
                        collectGrid.Rows[i].Cells["SOO_GUBUN_CD"].Value = dt.Rows[i]["SOO_GUBUN"].ToString();
                        collectGrid.Rows[i].Cells["SOO_GUBUN_NM"].Value = dt.Rows[i]["SOO_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]["SOO_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());
            }
        }
Beispiel #7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txt_cust_cd.Text.ToString().Equals(""))
            {
                MessageBox.Show("거래처를 선택하시기 바랍니다.");
                return;
            }



            if (ck)
            {
                int rsNum = new 스마트팩토리.Model.Query.scQuery().insertSoo(
                    dtp_date_soo.Text.ToString()
                    , txt_cust_cd.Text.ToString()
                    , txt_soo.Text.ToString()
                    , txt_dc.Text.ToString()
                    , txt_comm.Text.ToString()
                    , txt_total_money.Text.ToString()
                    , cmb_gubun.SelectedValue.ToString()
                    );

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

                    StringBuilder sb = new StringBuilder();
                    //sb.AppendLine("and A.ORDER_DATE >= '" + dtp_start.Text.ToString() + "' and  A.ORDER_DATE <= '" + dtp_end.Text.ToString() + "'");

                    //string str = queryStr(sb.ToString());
                    //order_list(grd_order, str);
                    reSetting();
                    MessageBox.Show("성공적으로 등록하였습니다.");
                }
                else if (rsNum == 1)
                {
                    MessageBox.Show("저장에 실패하였습니다");
                }
                else
                {
                    MessageBox.Show("Exception 에러");
                }
            }
            else
            {
                int rsNum = new 스마트팩토리.Model.Query.scQuery().updateSoo(
                    dtp_date_soo.Text.ToString()
                    , lbl_cd.Text.ToString()
                    , txt_cust_cd.Text.ToString()
                    , txt_soo.Text.ToString()
                    , txt_dc.Text.ToString()
                    , txt_comm.Text.ToString()
                    , txt_balance.Text.ToString()
                    , txt_total_money.Text.ToString()
                    , cmb_gubun.SelectedValue.ToString()
                    , txt_total_amt_Temp.Text.ToString()
                    , txt_soo_temp.Text.ToString()
                    , txt_dc_temp.Text.ToString()
                    );
                if (rsNum == 0)
                {
                    reSetting();
                    MessageBox.Show("성공적으로 수정하였습니다.");
                }
                else if (rsNum == 1)
                {
                    MessageBox.Show("저장에 실패하였습니다");
                }
                else
                {
                    MessageBox.Show("Exception 에러");
                }
            }
            grd_soo.Rows.Clear();
            grdSooLoad();
        }