コード例 #1
0
        private void inputLogic()
        {
            try
            {
                if (lbl_input_gbn.Text.Equals(""))
                {
                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.insert_Out_Jisi_List(
                        txt_Output_date.Text
                        , txt_cust_cd.Text
                        , txt_plan_date.Text
                        , txt_plan_cd.Text
                        , txt_tax_cd.Text
                        , ProductGrid
                        , TotalSumGrid
                        );

                    if (rsNum == 0)
                    {
                        //input_list(tdInputGrid, "where convert(varchar(10), Z.INTIME, 120) = convert(varchar(10), getDate(), 120) ");
                        //input_list(inputGrid, "where Z.INPUT_DATE >= '" + start_date.Text.ToString() + "' and  Z.INPUT_DATE <= '" + end_date.Text.ToString() + "'");
                        input_list("WHERE 1=1 AND A.COMPLETE_YN = 'N' ");

                        resetSetting();

                        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 에러");
                    }
                }
                else
                {
                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.Update_Out_Jisi_List(
                        txt_Output_date.Text
                        , txt_Output_cd.Text
                        , txt_cust_cd.Text
                        , txt_plan_date.Text
                        , txt_plan_cd.Text
                        , txt_tax_cd.Text
                        , ProductGrid
                        , TotalSumGrid
                        , del_inputTable
                        );

                    if (rsNum == 0)
                    {
                        input_list("WHERE 1=1 AND A.COMPLETE_YN = 'N' ");

                        resetSetting();
                        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 에러");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Exception 에러 발생");
                Console.WriteLine(ex.StackTrace);
                Console.WriteLine(ex.Message + ex);
            }
        }