コード例 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (txt_saup_nm.Text.ToString().Equals(""))
            {
                MessageBox.Show("사업자명을 입력하시기 바랍니다.");
            }

            byte[] saup_img;
            int    saup_img_size = 0;

            if (path != null && path != "")
            {
                saup_img      = ComInfo.GetImage(path);
                saup_img_size = saup_img.Length;
            }
            else
            {
                saup_img      = null;
                saup_img_size = 0;
            }

            wnDm wDm   = new wnDm();
            int  rsNum = wDm.updateSaup(
                saup_no,
                txt_saup_nm.Text.ToString(),
                txt_corporate.Text.ToString(),
                txt_uptae.Text.ToString(),
                txt_jongmok.Text.ToString(),
                txt_open_date.Text.ToString(),
                txt_post_no.Text.ToString(),
                txt_addr.Text.ToString(),
                txt_addr2.Text.ToString(),
                txt_comp_phone.Text.ToString(),
                txt_fax.Text.ToString(),
                txt_mg_email.Text.ToString(),
                txt_mg_phone.Text.ToString(),
                txt_homepage.Text.ToString(),
                saup_img,
                saup_img_size,
                Common.p_strCompNm
                );

            if (rsNum == 0)
            {
                MessageBox.Show("성공적으로 등록하였습니다.");
            }
            else if (rsNum == 1)
            {
                MessageBox.Show("저장에 실패하였습니다.");
            }
            else
            {
                MessageBox.Show("Exception 에러 ");
            }
        }
コード例 #2
0
        private void dgv_fac_picture_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == 2)
            {
                ofd.Filter = "*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*";
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    //이미지
                    image = Image.FromFile(ofd.FileName);
                    //이미지 경로
                    path     = ofd.FileName;
                    pic_name = Path.GetFileNameWithoutExtension(ofd.FileName);
                    /* 이미지 리사이즈 */
                    Image cus_img = pic_resize_logic(dgv_picture, image);

                    byte[] img;
                    int    img_size = 0;
                    if (path != null && path != "")
                    {
                        dgv_picture.Rows[e.RowIndex].Height                  = 194;
                        dgv_picture.Columns[e.ColumnIndex - 1].Width         = 300;
                        dgv_picture.Rows[e.RowIndex].Cells["PICTURE"].Value  = cus_img;
                        dgv_picture.Rows[e.RowIndex].Cells["IMG_NAME"].Value = pic_name;


                        img      = ComInfo.GetImage(path);
                        img_size = img.Length;

                        // MessageBox.Show(img_size.ToString());
                        dgv_picture.Rows[e.RowIndex].Cells["IMG_SIZE"].Value = img_size;
                        dgv_picture.Rows[e.RowIndex].Cells["PIC_PATH"].Value = img;
                    }
                    else
                    {
                        dgv_picture.Rows[e.RowIndex].Cells["PICTURE"].Value = null;
                        img_size = 0;
                    }
                }
            }
        }
コード例 #3
0
        private void saveLogic()
        {
            wnDm wDm = new wnDm();

            if (txt_check_yn.Text.ToString().Equals("S")) //대기
            {
                lblSearch.Text    = "등록중";
                lblSearch.Visible = true;
                Application.DoEvents();

                byte[] flow_img;
                int    flow_img_size = 0;
                if (path != null && path != "")
                {
                    flow_img      = ComInfo.GetImage(path);
                    flow_img_size = flow_img.Length;
                }
                else
                {
                    flow_img      = null;
                    flow_img_size = 0;
                }

                int rsNum = wDm.insertItemChkExam(txt_lot_no.Text.ToString()
                                                  , txt_lot_sub.Text.ToString()
                                                  , txt_f_step.Text.ToString()
                                                  , txt_item_cd.Text.ToString()
                                                  , txt_sub_amt.Text.ToString()
                                                  , txt_measure_cnt.Text.ToString()
                                                  , startIdx
                                                  , lblSearch
                                                  , flow_img
                                                  , flow_img_size
                                                  , dataChkGrid);
                if (rsNum == 0)
                {
                    chk_req_list();

                    txt_check_nm.Text = "미완료";
                    txt_check_yn.Text = "N";

                    MessageBox.Show("성공적으로 등록하였습니다.");
                }
                else if (rsNum == 1)
                {
                    MessageBox.Show("저장에 실패하였습니다");
                }
                else if (rsNum == 2)
                {
                    MessageBox.Show("SQL COMMAND 에러");
                }
                else if (rsNum == 3)
                {
                    MessageBox.Show("기존 코드가 있으니 \n 다른 코드로 입력 바랍니다.");
                }
                else
                {
                    MessageBox.Show("Exception 에러");
                }

                lblSearch.Visible = false;
            }
            else if (txt_check_yn.Text.ToString().Equals("N"))  // 미완료
            {
                byte[] flow_img;
                int    flow_img_size = 0;

                if (path != null && path != "")
                {
                    flow_img      = ComInfo.GetImage(path);
                    flow_img_size = flow_img.Length;

                    //flow_img = ImageToByte(pic_exam.Image);
                    //flow_img_size = flow_img.Length;
                }
                else
                {
                    flow_img      = null;
                    flow_img_size = 0;
                }

                lblSearch.Text    = "등록중";
                lblSearch.Visible = true;
                Application.DoEvents();

                int rsNum = wDm.updateItemChkExam(txt_lot_no.Text.ToString()
                                                  , txt_lot_sub.Text.ToString()
                                                  , txt_f_step.Text.ToString()
                                                  , startIdx
                                                  , lblSearch
                                                  , flow_img
                                                  , flow_img_size
                                                  , dataChkGrid);
                if (rsNum == 0)
                {
                    chk_req_list();

                    MessageBox.Show("성공적으로 등록하였습니다.");
                }
                else if (rsNum == 1)
                {
                    MessageBox.Show("저장에 실패하였습니다");
                }
                else if (rsNum == 2)
                {
                    MessageBox.Show("SQL COMMAND 에러");
                }
                else if (rsNum == 3)
                {
                    MessageBox.Show("기존 코드가 있으니 \n 다른 코드로 입력 바랍니다.");
                }
                else
                {
                    MessageBox.Show("Exception 에러");
                }

                lblSearch.Visible = false;
            }
        }
コード例 #4
0
        private void outputLogic()
        {
            try
            {
                if (txt_cust_cd.Text.ToString().Equals(""))
                {
                    MessageBox.Show("거래처를 선택하시기 바랍니다.");
                    return;
                }

                byte[] saup_img;
                int    saup_img_size = 0;
                if (path != null && path != "")
                {
                    saup_img      = ComInfo.GetImage(path);
                    saup_img_size = saup_img.Length;
                }
                else
                {
                    saup_img      = null;
                    saup_img_size = 0;
                }



                if (cbo전표상태.SelectedIndex == 1 && a == 0)
                {
                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.insert배송등록(
                        txt_out_date.Value.ToString().Substring(0, 10)

                        , txt입력방식.Text.ToString()
                        , cbo담당사원.SelectedValue.ToString()
                        , txt_cust_cd.Text.ToString()
                        , cbo배송사원.SelectedValue.ToString()
                        , cbo전표상태.SelectedValue.ToString()
                        , txt비고.Text.ToString()
                        , txt_staff_nm.Text.ToString()
                        , txt_staff_phone.Text.ToString()
                        , itemOutGrid
                        , str주문일자
                        , str주문번호
                        , str항목순번
                        , str주문시간
                        );

                    if (rsNum == 0)
                    {
                        MessageBox.Show("성공적으로 등록하였습니다.");
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다");
                    }
                    else if (rsNum == 2)
                    {
                        MessageBox.Show("SQL COMMAND 에러");
                    }
                    else if (rsNum == 3)
                    {
                        MessageBox.Show("기존 코드가 존재하므로 \n 다른 코드로 입력 바랍니다.");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러");
                    }
                }
                else if (cbo전표상태.SelectedIndex == 1 || a == 1)
                {
                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.update배송등록(
                        txt_out_date.Value.ToString().Substring(0, 10)
                        , txt_out_cd.Text.ToString()
                        , txt입력방식.Text.ToString()
                        , cbo담당사원.SelectedValue.ToString()
                        , txt_cust_nm.Text.ToString()
                        , cbo배송사원.SelectedValue.ToString()
                        , cbo전표상태.SelectedValue.ToString()
                        , txt비고.Text.ToString()
                        , txt_staff_nm.Text.ToString()
                        , txt_staff_phone.Text.ToString()
                        , itemOutGrid
                        , saup_img
                        , saup_img_size
                        );

                    if (rsNum == 0)
                    {
                        MessageBox.Show("성공적으로 수정하였습니다.");
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다");
                    }
                    else if (rsNum == 2)
                    {
                        MessageBox.Show("SQL COMMAND 에러");
                    }
                    else if (rsNum == 3)
                    {
                        MessageBox.Show("기존 코드가 존재하므로 \n 다른 코드로 입력 바랍니다.");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러");
                    }
                }

                else if (cbo전표상태.SelectedIndex == 2 || a == 1)
                {
                    if (pic.BackgroundImage == null)
                    {
                        MessageBox.Show("확인싸인을 입력하세요");
                        return;
                    }

                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.update배송등록(
                        txt_out_date.Value.ToString().Substring(0, 10)
                        , txt_out_cd.Text.ToString()
                        , txt입력방식.Text.ToString()
                        , cbo담당사원.SelectedValue.ToString()
                        , txt_cust_nm.Text.ToString()
                        , cbo배송사원.SelectedValue.ToString()
                        , cbo전표상태.SelectedValue.ToString()
                        , txt비고.Text.ToString()
                        , txt_staff_nm.Text.ToString()
                        , txt_staff_phone.Text.ToString()
                        , itemOutGrid
                        , saup_img
                        , saup_img_size
                        );

                    if (rsNum == 0)
                    {
                        MessageBox.Show("성공적으로 수정하였습니다.");
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다");
                    }
                    else if (rsNum == 2)
                    {
                        MessageBox.Show("SQL COMMAND 에러");
                    }
                    else if (rsNum == 3)
                    {
                        MessageBox.Show("기존 코드가 존재하므로 \n 다른 코드로 입력 바랍니다.");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러");
                    }
                }
            }
            catch (Exception e)
            {
                Popup.pop오류리포트 msg = new Popup.pop오류리포트(e.Message + " - " + e.ToString()); msg.ShowDialog();
            }
        }
コード例 #5
0
        private void Metal_Logic()
        {
            try
            {
                if (txt_faccd.Text.ToString().Equals(""))
                {
                    MessageBox.Show("관리번호를 입력하시기 바랍니다.");
                    return;
                }

                if (txt_facnm.Text.ToString().Equals(""))
                {
                    MessageBox.Show("제품명을 입력하시기 바랍니다.");
                    return;
                }

                if (txt_sn.Text.ToString().Equals(""))
                {
                    MessageBox.Show("장비S/N을 입력하시기 바랍니다.");
                    return;
                }



                if (path != null && path != "")
                {
                    flow_img      = ComInfo.GetImage(path);
                    flow_img_size = flow_img.Length;
                }
                else
                {
                    flow_img      = null;
                    flow_img_size = 0;
                }


                if (txt_price.Text.ToString() == "" | txt_price.Text.ToString() == null)
                {
                    txt_price.Text = "0";
                }

                if (txt_amount.Text.ToString() == "" | txt_amount.Text.ToString() == null)
                {
                    txt_amount.Text = "0";
                }

                if (txt_faccd.Enabled)
                {
                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.InsertFac(
                        txt_faccd.Text.ToString()
                        , txt_facnm.Text.ToString()
                        , txt_sn.Text.ToString()
                        , txt_spec.Text.ToString()
                        , int.Parse(txt_amount.Text.ToString().Replace(",", ""))
                        , dtp_makedate.Text.ToString()
                        , dtp_buydate.Text.ToString()
                        , int.Parse(txt_price.Text.ToString().Replace(",", ""))
                        , txt_makecust.Text.ToString()
                        , txt_comment.Text.ToString()
                        , txt생산능력.Text.ToString().Replace(",", "")
                        , cmb_mainten.SelectedValue.ToString().Replace(",", "")
                        , flow_img
                        , flow_img_size
                        , txt마력.Text.ToString().Replace(",", "")
                        , txt점검주기.Text.ToString().Replace(",", "")
                        , cmb_dept.SelectedValue.ToString()
                        );
                    if (rsNum == 0)
                    {
                        resetSetting();
                        MessageBox.Show("성공적으로 등록하였습니다.");
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다");
                    }
                    else if (rsNum == 2)
                    {
                        MessageBox.Show("SQL COMMAND 에러");
                    }
                    else if (rsNum == 3)
                    {
                        MessageBox.Show("기존 코드가 있으니 \n 다른 코드로 입력 바랍니다.");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러1");
                    }
                }
                else
                {
                    if (!right[1])
                    {
                        MessageBox.Show("권한이없습니다.");
                        return;
                    }
                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.UpdateFac(
                        txt_faccd.Text.ToString()
                        , txt_facnm.Text.ToString()
                        , txt_sn.Text.ToString()
                        , txt_spec.Text.ToString()
                        , int.Parse(txt_amount.Text.ToString())
                        , dtp_makedate.Text.ToString()
                        , dtp_buydate.Text.ToString()
                        , int.Parse(txt_price.Text.ToString())
                        , txt_makecust.Text.ToString()
                        , txt_comment.Text.ToString()
                        );
                    if (rsNum == 0)
                    {
                        MessageBox.Show("성공적으로 수정하였습니다.");
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러");
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }
コード例 #6
0
        private void saveLogic()
        {
            try
            {
                if (pictureBox1.BackgroundImage == null)
                {
                    MessageBox.Show("도면사진을 등록해주세요.");
                    return;
                }



                if (img_size == 0)
                {
                    if (ImgPath != null && ImgPath != "")
                    {
                        img      = ComInfo.GetImage(ImgPath);
                        img_size = img.Length;
                    }
                    else
                    {
                        img      = null;
                        img_size = 0;
                    }
                }



                wnDm wDm = new wnDm();
                if (lbl_gbn.Text.Equals("1")) /*신규등록*/
                {
                    int rsNum = wnDm.floorPlanSave(
                        dtp_input_date.Text,
                        txtFloorPlanNm.Text,
                        img,
                        img_size,
                        Common.p_strStaffNo,
                        txt_comment.Text,
                        "1"); //1은 구분자 1.도면 2.밀시트

                    if (rsNum == 0)
                    {
                        MessageBox.Show("성공적으로 등록하였습니다.");
                        grid_list();
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다.");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러 ");
                    }
                }


                else if (lbl_gbn.Text.Equals("0")) /*테이블 더블클릭시 -> 수정*/
                {
                    int rsNum = wnDm.floorPlanUpdate(
                        dtp_input_date.Text,
                        txt_input_cd.Text,
                        txtFloorPlanNm.Text,
                        ip,
                        img_size,
                        Common.p_strStaffNo,
                        txt_comment.Text);

                    if (rsNum == 0)
                    {
                        MessageBox.Show("성공적으로 수정하였습니다.");
                        grid_list();
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다.");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러 ");
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #7
0
        private void Metal_Logic()
        {
            try
            {
                if (txt_metalcd.Text.ToString().Equals(""))
                {
                    MessageBox.Show("메탈코드를 입력하시기 바랍니다.");
                    return;
                }

                if (txt_modelnm.Text.ToString().Equals(""))
                {
                    MessageBox.Show("모델명을 입력하시기 바랍니다.");
                    return;
                }

                byte[] flow_img;
                int    flow_img_size = 0;
                if (path != null && path != "")
                {
                    flow_img      = ComInfo.GetImage(path);
                    flow_img_size = flow_img.Length;
                }
                else
                {
                    flow_img      = null;
                    flow_img_size = 0;
                }


                if (txt_metalcd.Enabled)
                {
                    string lot_no = dtp_inputdate.Text.ToString().Replace("-", "");
                    lot_no = lot_no.Substring(2).ToString();

                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.Insert_Metal(
                        txt_metalcd.Text.ToString()
                        , txt_modelnm.Text.ToString()
                        , dtp_makedate.Text.ToString()
                        , txt_spec.Text.ToString()
                        , txt_ordercust.Text.ToString()
                        , txt_makecust.Text.ToString()
                        , dtp_inputdate.Text.ToString()
                        , txt_comment.Text.ToString()
                        , lot_no
                        );
                    if (rsNum == 0)
                    {
                        resetSetting();
                        MessageBox.Show("성공적으로 등록하였습니다.");
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다");
                    }
                    else if (rsNum == 2)
                    {
                        MessageBox.Show("SQL COMMAND 에러");
                    }
                    else if (rsNum == 3)
                    {
                        MessageBox.Show("기존 코드가 있으니 \n 다른 코드로 입력 바랍니다.");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러1");
                    }
                }
                else
                {
                    wnDm wDm   = new wnDm();
                    int  rsNum = wDm.Update_Metal(
                        txt_metalcd.Text.ToString()
                        , txt_modelnm.Text.ToString()
                        , dtp_makedate.Text.ToString()
                        , txt_spec.Text.ToString()
                        , txt_ordercust.Text.ToString()
                        , txt_makecust.Text.ToString()
                        , dtp_inputdate.Text.ToString()
                        , txt_comment.Text.ToString()
                        );
                    if (rsNum == 0)
                    {
                        MessageBox.Show("성공적으로 수정하였습니다.");
                    }
                    else if (rsNum == 1)
                    {
                        MessageBox.Show("저장에 실패하였습니다");
                    }
                    else
                    {
                        MessageBox.Show("Exception 에러");
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString());
            }
        }