public void confirmBtn_Click(string code_value)
        {
            //입력,수정,삭제시 값 물어보기.
            if (ipgo_code.Text == "")
            {
                MessageBox.Show("물품코드를 입력해주세요.");
                return;
            }
            else if (ipgo_date.Text == "")
            {
                MessageBox.Show("입고일자를 입력해주세요.");
                return;
            }
            else if (ipgo_cnt.Text == "")
            {
                MessageBox.Show("입고량을 입력해주세요.");
                return;
            }
            else if (ipgo_comp.Text == "")
            {
                MessageBox.Show("입고처를 입력해주세요.");
                return;
            }
            else if (ipgo_amt.Text == "")
            {
                MessageBox.Show("입고가를 입력해주세요.");
                return;
            }



            Ipgo myipgo = new Ipgo();
            Dictionary <String, String> ipgo_value = make_ipgo_values();


            Console.WriteLine(ipgo_value);

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


                myipgo.update(ipgo_value, item_samt.Text);
            }
            else if (code_value == "D")
            {
                myipgo.delete(ipgo_code.Text, ipgo_date.Text, item_samt.Text);
            }

            ipgo_code.Enabled = true;
            ipgo_date.Enabled = true;

            clear();
            serch_gridView();
            form_code_value = "";
        }
        //이벤트가 비슷하면 묶기

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

            ipgo_value = myipgo.checking_ipgoID(ipgo_code.Text);
            if (ipgo_value == null)
            {
                MessageBox.Show("아이디가 존재 하지 않습니다.");
                return(false);
            }
            else
            {
                //아이디 뿌리기
                ipgo_date.Text = ipgo_value["ipgo_date"].ToString();
                ipgo_cnt.Text  = ipgo_value["ipgo_cnt"].ToString();
                ipgo_comp.Text = ipgo_value["ipgo_comp"].ToString();
                ipgo_amt.Text  = ipgo_value["ipgo_amt"].ToString();



                //이미지 뿌리기
                renderImage(ipgo_code.Text);
            }

            ipgo_code.Enabled = false;
            ipgo_date.Enabled = false;


            form_code_value = "C";

            return(true);
        }
示例#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 ipgo_id)
        {
            Ipgo myipgo = new Ipgo();
            Dictionary <String, byte[]> img_value = new Dictionary <string, byte[]>();

            img_value = myipgo.checking_ipgo_img(ipgo_id);
            if (img_value == null)
            {
                pictureBox1.Image = null;
            }
            else
            {
                pictureBox1.Image = new Bitmap(new MemoryStream(img_value["img"]));
            }
        }
        private void ipgoGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            ipgo_code.Text = ipgoGridView.Rows[e.RowIndex].Cells["grid_ipgo_code"].Value.ToString();
            item_name.Text = ipgoGridView.Rows[e.RowIndex].Cells["grid_item_name"].Value.ToString();
            item_samt.Text = ipgoGridView.Rows[e.RowIndex].Cells["grid_item_samt"].Value.ToString();
            ipgo_date.Text = ipgoGridView.Rows[e.RowIndex].Cells["grid_ipgo_date"].Value.ToString();
            ipgo_cnt.Text  = ipgoGridView.Rows[e.RowIndex].Cells["grid_ipgo_cnt"].Value.ToString();
            ipgo_comp.Text = ipgoGridView.Rows[e.RowIndex].Cells["grid_ipgo_comp"].Value.ToString();
            ipgo_amt.Text  = ipgoGridView.Rows[e.RowIndex].Cells["grid_ipgo_amt"].Value.ToString();


            String ipgoCode = ipgoGridView.Rows[e.RowIndex].Cells["grid_ipgo_code"].Value.ToString();

            Ipgo myipgo = new Ipgo();

            renderImage(ipgoCode);
        }
        public void serch_gridView()
        {
            Ipgo myipgo = new Ipgo();


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

            // List 배열값
            ipgo_values = myipgo.serch(item_name_serch.Text, ipgo_comp_serch.Text, ipgo_date_serch.Text, ipgo_date_serch2.Text);



            ipgoGridView.Rows.Clear();



            int index = 1;

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


                Console.WriteLine(rowIdw);

                row.Cells["grid_ipgo_code"].Value = ipgo_ipgo["item_code"].ToString();
                row.Cells["grid_item_name"].Value = ipgo_ipgo["item_name"].ToString();
                row.Cells["grid_item_samt"].Value = ipgo_ipgo["item_samt"].ToString();
                row.Cells["grid_ipgo_date"].Value = ipgo_ipgo["ipgo_date"].ToString();
                row.Cells["grid_ipgo_cnt"].Value  = ipgo_ipgo["ipgo_cnt"].ToString();
                row.Cells["grid_ipgo_comp"].Value = ipgo_ipgo["ipgo_comp"].ToString();
                row.Cells["grid_ipgo_amt"].Value  = ipgo_ipgo["ipgo_amt"].ToString();
                row.Cells["grid_index"].Value     = index;
                index++;
            }
        }
示例#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;
            }
        }