public void serch_gridView()
        {
            Culgo myculgo = new Culgo();


            List <Dictionary <String, String> > culgo_values = new List <Dictionary <string, string> >();

            // List 배열값
            culgo_values = myculgo.serch(item_name_serch.Text, culgo_date_serch.Text, culgo_date_serch2.Text);



            culgoGridView.Rows.Clear();


            int index = 1;

            foreach (Dictionary <string, string> culgo_culgo in culgo_values)
            {
                rowIdw = culgoGridView.Rows.Add();
                row    = culgoGridView.Rows[rowIdw];

                Console.WriteLine(rowIdw);

                row.Cells["grid_culgo_code"].Value = culgo_culgo["item_code"].ToString();
                row.Cells["grid_item_name"].Value  = culgo_culgo["item_name"].ToString();
                row.Cells["grid_item_samt"].Value  = culgo_culgo["item_samt"].ToString();
                row.Cells["grid_culgo_date"].Value = culgo_culgo["culgo_date"].ToString();
                row.Cells["grid_culgo_cnt"].Value  = culgo_culgo["culgo_cnt"].ToString();
                row.Cells["grid_culgo_amt"].Value  = culgo_culgo["culgo_amt"].ToString();
                row.Cells["grid_index"].Value      = index;
                index++;
            }
        }
        //이벤트가 비슷하면 묶기

        public bool change_deleteBtn_Click()
        {
            // 아이디 체크후 값 뿌려주기.
            Culgo myculgo = new Culgo();
            Dictionary <String, String> culgo_value = new Dictionary <string, string>();

            culgo_value = myculgo.checking_culgoID(culgo_code.Text);
            if (culgo_value == null)
            {
                MessageBox.Show("아이디가 존재 하지 않습니다.");
                return(false);
            }
            else
            {
                //아이디 뿌리기
                culgo_date.Text = culgo_value["culgo_date"].ToString();
                culgo_cnt.Text  = culgo_value["culgo_cnt"].ToString();
                culgo_sau.Text  = culgo_value["culgo_sau"].ToString();
                culgo_amt.Text  = culgo_value["culgo_amt"].ToString();



                //이미지 뿌리기
                renderImage(culgo_code.Text);
            }
            culgo_code.Enabled = false;
            culgo_date.Enabled = false;


            form_code_value = "C";

            return(true);
        }
Exemple #3
0
        private void ItemGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            //입고든 출고든 item_code로 받기
            string item_code = ItemGridView.Rows[e.RowIndex].Cells["Column1"].Value.ToString();



            Ipgo myipgo = new Ipgo();


            List <Dictionary <String, String> > ipgo_values = new List <Dictionary <string, string> >();

            // List 배열값

            ipgo_values = myipgo.serch_stock(item_code, ipgo_date_serch.Text, ipgo_date_serch2.Text);


            ipgoGridView.Rows.Clear();

            foreach (Dictionary <string, string> ipgo_ipgo in ipgo_values)
            {
                rowIdw = ipgoGridView.Rows.Add();
                row    = ipgoGridView.Rows[rowIdw];


                row.Cells["item_cnt"].Value  = ipgo_ipgo["item_samt"].ToString();
                row.Cells["ipgo_date"].Value = ipgo_ipgo["ipgo_date"].ToString();
                row.Cells["ipgo_cnt"].Value  = ipgo_ipgo["ipgo_cnt"].ToString();
                row.Cells["ipgo_comp"].Value = ipgo_ipgo["ipgo_comp"].ToString();
                row.Cells["ipgo_amt"].Value  = ipgo_ipgo["ipgo_amt"].ToString();
            }



            Culgo myculgo = new Culgo();


            List <Dictionary <String, String> > culgo_values = new List <Dictionary <string, string> >();

            // List 배열값
            culgo_values = myculgo.serch_stock(item_code, culgo_date_serch.Text, culgo_date_serch2.Text);



            culgoGridView.Rows.Clear();

            foreach (Dictionary <string, string> culgo_culgo in culgo_values)
            {
                rowIdw = culgoGridView.Rows.Add();
                row    = culgoGridView.Rows[rowIdw];

                row.Cells["item_cnt2"].Value  = culgo_culgo["item_samt"].ToString();
                row.Cells["culgo_date"].Value = culgo_culgo["culgo_date"].ToString();
                row.Cells["culgo_cnt"].Value  = culgo_culgo["culgo_cnt"].ToString();
                row.Cells["culgo_amt"].Value  = culgo_culgo["culgo_amt"].ToString();
            }
        }
        public void renderImage(String culgo_id)
        {
            Culgo myculgo = new Culgo();
            Dictionary <String, byte[]> img_value = new Dictionary <string, byte[]>();

            img_value = myculgo.checking_culgo_img(culgo_id);
            if (img_value == null)
            {
                pictureBox1.Image = null;
            }
            else
            {
                pictureBox1.Image = new Bitmap(new MemoryStream(img_value["img"]));
            }
        }
        private void culgoGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            culgo_code.Text = culgoGridView.Rows[e.RowIndex].Cells["grid_culgo_code"].Value.ToString();
            item_name.Text  = culgoGridView.Rows[e.RowIndex].Cells["grid_item_name"].Value.ToString();
            item_samt.Text  = culgoGridView.Rows[e.RowIndex].Cells["grid_item_samt"].Value.ToString();
            culgo_date.Text = culgoGridView.Rows[e.RowIndex].Cells["grid_culgo_date"].Value.ToString();
            culgo_cnt.Text  = culgoGridView.Rows[e.RowIndex].Cells["grid_culgo_cnt"].Value.ToString();
            culgo_amt.Text  = culgoGridView.Rows[e.RowIndex].Cells["grid_culgo_amt"].Value.ToString();



            String culgoCode = culgoGridView.Rows[e.RowIndex].Cells["grid_culgo_code"].Value.ToString();

            Culgo myculgo = new Culgo();

            renderImage(culgoCode);
        }
        public void confirmBtn_Click(string code_value)
        {
            //입력,수정,삭제시 값 물어보기.

            if (culgo_code.Text == "")
            {
                MessageBox.Show("물품코드를 입력해주세요.");
                return;
            }
            else if (culgo_date.Text == "")
            {
                MessageBox.Show("출고일자를 입력해주세요.");
                return;
            }
            else if (culgo_cnt.Text == "")
            {
                MessageBox.Show("출고량을 입력해주세요.");
                return;
            }
            else if (culgo_sau.Text == "")
            {
                MessageBox.Show("사유를 입력해주세요.");
                return;
            }
            else if (culgo_amt.Text == "")
            {
                MessageBox.Show("입고가를 입력해주세요.");
                return;
            }



            Culgo myculgo = new Culgo();
            Dictionary <String, String> culgo_value = make_culgo_values();



            if (code_value == "I")
            {
                myculgo.insert(culgo_value, item_samt.Text);
            }
            else if (code_value == "C")
            {
                //현재 재고량 넘겨주기


                myculgo.update(culgo_value, item_samt.Text);
            }
            else if (code_value == "D")
            {
                myculgo.delete(culgo_code.Text, culgo_date.Text, item_samt.Text);
            }

            clear();
            serch_gridView();


            culgo_code.Enabled = true;
            culgo_date.Enabled = true;

            form_code_value = "";
        }
Exemple #7
0
        public void Statement_Load(object sender, EventArgs e)
        {
            Item myItem = new Item();

            List <Dictionary <String, String> > stock_values = new List <Dictionary <string, string> >();



            stock_values = myItem.get_stock();



            stockChart.Series.Clear();

            Series s1 = new Series("물품명");

            stockChart.Series.Add(s1);


            List <string> xValues = new List <string>();
            List <int>    yValues = new List <int>();



            foreach (Dictionary <string, string> stock_stock in stock_values)
            {
                xValues.Add(stock_stock["item_name"].ToString());
                yValues.Add(Int32.Parse(stock_stock["item_samt"]));
            }

            s1.Points.DataBindXY(xValues, yValues);

            s1.ChartType = SeriesChartType.Column;

            s1.BorderWidth = 12;


            s1.Color = Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(122)))), ((int)(((byte)(224)))));

            s1.IsValueShownAsLabel = true;
            s1.BackGradientStyle   = GradientStyle.DiagonalRight;

            stockChart.ChartAreas[0].AxisX.MajorGrid.Enabled       = false;
            stockChart.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.NotSet;
            stockChart.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.NotSet;



            Culgo myculgo2 = new Culgo();

            List <Dictionary <String, String> > bestCulgos = new List <Dictionary <string, string> >();

            bestCulgos = myculgo2.get_culgo_best();



            bestChart.Series.Clear();

            Series s2 = new Series("물품명");

            bestChart.Series.Add(s2);


            List <string> xValues2 = new List <string>();
            List <int>    yValues2 = new List <int>();

            foreach (Dictionary <string, string> best_item in bestCulgos)
            {
                xValues2.Add(best_item["item_name"].ToString());
                yValues2.Add(Int32.Parse(best_item["sum"]));

                //Console.WriteLine(best_item["item_name"].ToString());
                //Console.WriteLine(best_item["sum"].ToString());
            }

            s2.Points.DataBindXY(xValues2, yValues2);
            s2.ChartType = SeriesChartType.Column;

            s2.BorderWidth = 12;

            s2.Color = Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(122)))), ((int)(((byte)(224)))));

            s2.IsValueShownAsLabel = true;
            s2.BackGradientStyle   = GradientStyle.DiagonalRight;

            bestChart.ChartAreas[0].AxisX.MajorGrid.Enabled       = false;
            bestChart.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.NotSet;
            bestChart.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.NotSet;



            /**
             * 입고정보
             */

            Ipgo myipgo = new Ipgo();


            List <Dictionary <String, String> > ipgo_values = new List <Dictionary <string, string> >();

            // List 배열값
            ipgo_values = myipgo.get_ipgo_info();



            ipgo_list.Items.Clear();


            int index = 1;

            foreach (Dictionary <string, string> ipgo_ipgo in ipgo_values)
            {
                string ipgo_name = ipgo_ipgo["item_name"].ToString();
                string ipgo_date = ipgo_ipgo["ipgo_date"].ToString();
                string ipgo_cnt  = ipgo_ipgo["ipgo_cnt"].ToString();

                ipgo_list.Items.Add(index + ".  ( " + ipgo_date + " ) " + ipgo_name + "(이)가 " + ipgo_cnt + "개 입고 되었습니다.");

                index = index + 1;
            }



            /**
             * 출고정보
             */

            Culgo myculgo = new Culgo();


            List <Dictionary <String, String> > culgo_values = new List <Dictionary <string, string> >();

            // List 배열값
            culgo_values = myculgo.get_culgo_info();


            culgo_list.Items.Clear();


            int culgo_index = 1;

            foreach (Dictionary <string, string> ipgo_ipgo in culgo_values)
            {
                string culgo_name = ipgo_ipgo["item_name"].ToString();
                string culgo_date = ipgo_ipgo["culgo_date"].ToString();
                string culgo_cnt  = ipgo_ipgo["culgo_cnt"].ToString();

                culgo_list.Items.Add(culgo_index + ".  ( " + culgo_date + " ) " + culgo_name + "(이)가 " + culgo_cnt + "개 출고 되었습니다.");

                culgo_index = culgo_index + 1;
            }
        }