Ejemplo n.º 1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //조회버튼
            try
            {
                MaterialStockVO vo = new MaterialStockVO();

                if (txtProductCode.Text != "")
                {
                    vo.product_codename = txtProductCode.Text;
                }

                if (cboProductType.Text != "선택")
                {
                    vo.product_type = cboProductType.Text;
                }

                if (cboFactory.Text != "선택")
                {
                    vo.factory_code = cboFactory.SelectedValue.ToString();
                }

                StockService service = new StockService();
                DataTable    dt      = service.GetMaterialStockList(vo);
                SetDataGrid();
                dataGridView1.DataSource = dt;
                // SetRowNumber();

                //dataGridView1.Columns[6].DefaultCellStyle.BackColor = Color.Red;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 2
0
        private void MaterialReceiving_Load(object sender, EventArgs e)
        {
            dtpStartDate.Value = DateTime.Now;
            dtpEndDate.Value   = DateTime.Now.AddMonths(+1);

            //발주업체, 주문상태 콤보박스 바인딩
            OrderService          oService = new OrderService();
            MaterialLedgerService mService = new MaterialLedgerService();

            CompanyList    = new List <CompanyVO>();
            orderStateList = new List <OrderStateVO>();

            try
            {
                CompanyList = oService.GetCompanyAll("customer");
                ComboUtil.ComboBinding(cboCompany, CompanyList, "company_code", "company_name", "선택");

                orderStateList = mService.GetOrderState();
                ComboUtil.ComboBinding(cboOrderState, orderStateList, "state_code", "state_name", "선택");
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }

            SetDataGridWatingReceiving();
            SetDataGridResult();
        }
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex > 0)
            {
                return;
            }

            try
            {
                int  p_id    = Convert.ToInt32(dataGridView1.CurrentRow.Cells[1].Value);
                bool bresult = !Convert.ToBoolean(dataGridView1.CurrentRow.Cells[0].EditedFormattedValue);

                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    if (Convert.ToInt32(dataGridView1.Rows[i].Cells[1].Value) == p_id)
                    {
                        dataGridView1.Rows[i].Cells[0].Value = bresult;
                    }
                    else
                    {
                        if (bresult)
                        {
                            dataGridView1.Rows[i].Cells[0].Value = !bresult;
                        }
                    }
                }
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 4
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //조회 버튼
            try
            {
                SupplierVO vo = new SupplierVO();
                vo.order_state = "O_COMPLETE";
                vo.start_date  = dtpStartDate.Value.ToShortDateString();
                vo.end_date    = dtpEndDate.Value.ToShortDateString();

                if (cboCompany.Text != "선택")
                {
                    vo.company_name = cboCompany.Text;
                }

                if (txtOrderID.Text != "")
                {
                    vo.order_id = txtOrderID.Text;
                }

                SetDataGridWatingReceiving();
                SetDataGridResult();

                SupplierService service = new SupplierService();
                dt = service.GetAlreadyOrderList(vo);

                dgvWatingReceive.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 5
0
        private void btnG_Update_Click(object sender, EventArgs e)
        {
            try
            {
                MachineGradeVO VO = new MachineGradeVO();
                VO.mgrade_id      = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value);
                VO.mgrade_code    = dataGridView1.CurrentRow.Cells[1].Value.ToString();
                VO.mgrade_name    = dataGridView1.CurrentRow.Cells[2].Value.ToString();
                VO.mgrade_yn      = dataGridView1.CurrentRow.Cells[3].Value.ToString();
                VO.mgrade_uadmin  = dataGridView1.CurrentRow.Cells[4].Value.ToString();
                VO.mgrade_udate   = dataGridView1.CurrentRow.Cells[5].Value.ToString();
                VO.mgrade_comment = dataGridView1.CurrentRow.Cells[6].Value.ToString();
                FacilitiesPop frm = new FacilitiesPop(FacilitiesPop.EditMode.Update, VO);

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    LoadData();
                    SetBottomStatusLabel("설비군 수정 성공");
                }
                txtCode.Text    = dataGridView1.CurrentRow.Cells[1].Value.ToString();
                txtName.Text    = dataGridView1.CurrentRow.Cells[2].Value.ToString();
                txtAdmin.Text   = dataGridView1.CurrentRow.Cells[4].Value.ToString();
                txtDate.Text    = dataGridView1.CurrentRow.Cells[5].Value.ToString();
                txtComment.Text = dataGridView1.CurrentRow.Cells[6].Value.ToString();
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 6
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult dr = MessageBox.Show(dataGridView2.CurrentRow.Cells[4].Value.ToString() + " 를(을) 삭제하시겠습니까?", "알림", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (dr == DialogResult.OK)
                {
                    bool bResult = R_service.DeleteMachin(Convert.ToInt32(lblID2.Text));

                    if (bResult)
                    {
                        MessageBox.Show("삭제완료");
                        SetBottomStatusLabel("삭제 성공");
                        LoadData();
                    }
                    else if (!bResult)
                    {
                        MessageBox.Show("삭제 실패");
                        SetBottomStatusLabel("삭제 실패");
                        return;
                    }
                }
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 7
0
        private void btnWork_Click(object sender, EventArgs e)
        {
            try
            {
                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    if (Convert.ToBoolean(dataGridView1.Rows[i].Cells[0].Value) == true)            //체크박스가 true?
                    {
                        lst.Add(Convert.ToInt32(dataGridView1.Rows[i].Cells[12].Value.ToString())); //true인 행의 아이디를 가져옴
                        strlist.Add(dataGridView1.Rows[i].Cells[10].Value.ToString());
                    }
                }
                int k = lst.Count;
                lst = lst.Distinct().ToList(); //중복제거
                int t = lst.Count;
                strlist = strlist.Distinct().ToList();

                //bool bResult = false;
                for (int i = 0; i < strlist.Count; i++)
                {
                    /*  bResult =*/
                    P_service.UpdateCommand(Convert.ToInt32(lst[i].ToString()), strlist[i].ToString());
                }
                //if (bResult)
                LoadData();
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 8
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //변경버튼
            if (MessageBox.Show($"\"{dtpTobeDate.Value.ToShortDateString()}\"으로 변경하시겠습니까?", "날짜변경", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                vo.order_pdate = dtpTobeDate.Value.ToShortDateString();

                try
                {
                    PurchasingService service = new PurchasingService();
                    bool result = service.UpdateOrderDate(vo);

                    if (result)
                    {
                        MessageBox.Show("납기일이 성공적으로 변경되었습니다.", "날짜변경", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("납기일 변경에 실패하였습니다.", "날짜변경", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                }
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 9
0
        private void ExcelDown()
        {
            try
            {
                Excel.Application excel = new Excel.Application
                {
                    Visible = true
                };

                string filename = "test" + ".xlsx";

                string tempPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), filename);
                //byte[] temp = Properties.Resources.order;

                //System.IO.File.WriteAllBytes(tempPath, temp);

                Excel._Workbook workbook;

                workbook = excel.Workbooks.Add(System.Reflection.Missing.Value);//tempPath

                Excel.Worksheet sheet1 = (Excel.Worksheet)workbook.Sheets[1];

                int StartCol = 1;
                int StartRow = 1;
                int j = 0, i = 0;

                //Write Headers
                for (j = 0; j < dataGridView1.Columns.Count - 3; j++)
                {
                    Excel.Range myRange = (Excel.Range)sheet1.Cells[StartRow, StartCol + j];
                    myRange.Value2 = dataGridView1.Columns[j].HeaderText;
                }

                StartRow++;

                //Write datagridview content
                for (i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    for (j = 0; j < dataGridView1.Columns.Count - 3; j++)
                    {
                        try
                        {
                            Excel.Range myRange = (Excel.Range)sheet1.Cells[StartRow + i, StartCol + j];
                            myRange.Value2 = dataGridView1[j, i].Value == null ? "" : dataGridView1[j, i].Value;
                        }
                        catch (Exception err)
                        {
                            MessageBox.Show(err.Message);
                        }
                    }
                }

                SetBottomStatusLabel("다운로드가 완료되었습니다.");
            }
            catch (Exception ex)
            {
                LoggingUtility.GetLoggingUtility(ex.Message, Level.Error);
                SetBottomStatusLabel("다운로드에 실패하였습니다.");
            }
        }
Ejemplo n.º 10
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                MaterialSearchVO vo = new MaterialSearchVO();
                vo.startDate = dtpStartDate.Value.ToShortDateString();
                vo.endDate   = dtpEndDate.Value.ToShortDateString();

                if (cboFactory.Text != "선택")
                {
                    vo.factory_name = cboFactory.Text;
                }
                if (cboProductType.Text != "선택")
                {
                    vo.product_type = cboProductType.Text;
                }
                if (txtProduct.Text != "")
                {
                    vo.product_name = txtProduct.Text;
                }

                StockService service = new StockService();
                DataTable    dt      = service.GetInOutHistory(vo);
                SetDataGrid();
                dataGridView1.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 11
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            ResourceService R_service = new ResourceService();

            try
            {
                DialogResult dr = MessageBox.Show(dataGridView1.CurrentRow.Cells[2].Value.ToString() + " 를(을) 삭제하시겠습니까?", "알림", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (dr == DialogResult.OK)
                {
                    R_service = new ResourceService();
                    bool bResult = R_service.DeleteBOR(Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value));

                    if (bResult)
                    {
                        LoadData();
                        SetBottomStatusLabel("삭제완료");
                        MessageBox.Show("삭제완료");
                    }
                    else if (!bResult)
                    {
                        SetBottomStatusLabel("삭제실패");
                        MessageBox.Show("삭제 실패");
                        return;
                    }
                }
            }
            catch (Exception err)
            {
                string str = err.Message;
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 12
0
        private void OrderList_Load(object sender, EventArgs e)
        {
            dtpStartDate.Value = DateTime.Now;
            dtpEndDate.Value   = DateTime.Now.AddMonths(+1);

            OrderService service = new OrderService();

            //발주업체 콤보박스 바인딩
            CompanyList = new List <CompanyVO>();

            try
            {
                CompanyList = service.GetCompanyAll("customer");
                ComboUtil.ComboBinding(cboCompany, CompanyList, "company_code", "company_name", "선택");
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }


            //PurchasingService service = new PurchasingService();

            //dt = service.GetOrderList();

            SetDataGrid();

            //SetRowNumber();
        }
Ejemplo n.º 13
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //조회 버튼
            WhereSoVO vo = new WhereSoVO();

            vo.startDate = dtpStartDate.Value.ToShortDateString();
            vo.endDate   = dtpEndDate.Value.ToShortDateString();

            vo.RegStartDate = dtpRegFirstDate.Value.ToShortDateString();
            vo.RegEndDate   = dtpRegLastDate.Value.ToShortDateString();

            if (cboCompany.Text != "선택")
            {
                vo.CompanyName = cboCompany.Text;
            }

            OrderService service = new OrderService();

            try
            {
                List <SOMasterVO> list = service.GetSOMasterAll(vo);
                dataGridView1.DataSource = list;
                SetBottomStatusLabel("조회가 완료되었습니다.");
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                SetBottomStatusLabel("조회에 실패하였습니다. 다시 시도하여 주십시오.");
            }
        }
Ejemplo n.º 14
0
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            dataGridView1.Columns.Clear();

            string planID = cboPlanID.Text;

            try
            {
                OrderService service = new OrderService();

                DataTable dt = service.GetMRP(planID, dtpStartDate.Value.ToShortDateString(), dtpEndDate.Value.ToShortDateString());

                dt.Columns[0].ColumnName    = "품목";
                dt.Columns[1].ColumnName    = "품명";
                dt.Columns[2].ColumnName    = "Plan ID";
                dt.Columns[3].ColumnName    = "카테고리";
                dt.Columns[4].ColumnMapping = MappingType.Hidden;
                dt.Columns[5].ColumnMapping = MappingType.Hidden;

                dataGridView1.DataSource = dt;
                //GridViewUtil.SetDataGridView(dataGridView1);

                SetBottomStatusLabel("조회가 완료되었습니다.");
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 15
0
        private void MRP_Load(object sender, EventArgs e)
        {
            try
            {
                OrderService service = new OrderService();

                List <string> planIDlist = service.GetPlanID();
                cboPlanID.DataSource = planIDlist;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }

            //string planID = cboPlanID.Text;

            dataGridView1.RowsDefaultCellStyle.BackColor            = Color.FromArgb(240, 240, 240);
            dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
            dataGridView1.DefaultCellStyle.SelectionBackColor       = Color.Gray; //Color.DimGray;
            dataGridView1.DefaultCellStyle.SelectionForeColor       = Color.White;

            dtpStartDate.Value = DateTime.Now;
            dtpEndDate.Value   = DateTime.Now.AddMonths(+1).AddDays(-1);

            //dataGridView1.DataSource = service.GetMRP(planID, dtpStartDate.Value.ToShortDateString(), dtpEndDate.Value.ToShortDateString());
        }
Ejemplo n.º 16
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (lblID.Text != "")
         {
             BORPop frm = new BORPop(BORPop.EditMode.Update, lblID.Text, lblRoute.Text);
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 LoadData();
                 SetBottomStatusLabel("수정 성공");
                 MessageBox.Show("수정 성공");
             }
         }
         else
         {
             SetBottomStatusLabel("선택된 BOR이 없습니다");
             MessageBox.Show("선택된 BOR이 없습니다.");
         }
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Ejemplo n.º 17
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (lblID1.Text != "")
                {
                    FacilitieInfoPop frm = new FacilitieInfoPop
                                               (FacilitieInfoPop.EditMode.Input, dataGridView1.CurrentRow.Cells[1].Value.ToString(), lblID1.Text);

                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        LoadData();
                        SetBottomStatusLabel("신규 설비 등록 성공");
                    }
                }
                else if (lblID1.Text == "")
                {
                    MessageBox.Show("설비군을 선택해주세요");
                }
                SetBottomStatusLabel("선택된 설비군이 없습니다");
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 18
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //조회 버튼
            try
            {
                SupplierVO vo = new SupplierVO();
                vo.start_date = dtpStartDate.Value.ToShortDateString();
                vo.end_date   = dtpEndDate.Value.ToShortDateString();

                if (cboCompany.Text != "선택")
                {
                    vo.company_name = cboCompany.Text;
                }

                if (cboOrderState.Text != "선택")
                {
                    vo.order_state = cboOrderState.SelectedValue.ToString();
                }

                MaterialLedgerService service = new MaterialLedgerService();
                dt = service.GetWatingReceivingList(vo);

                dgvWatingList.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 19
0
        private void SalesMaster_Load(object sender, EventArgs e)
        {
            //납기일 초기화
            dtpStartDate.Value = DateTime.Now;
            dtpEndDate.Value   = DateTime.Now.AddMonths(+1).AddDays(-1);

            //등록일 초기화
            dtpRegFirstDate.Value = DateTime.Now.AddMonths(-1);
            dtpRegLastDate.Value  = DateTime.Now;

            OrderService service = new OrderService();

            //List<SOMasterVO> list = service.GetSOMasterAll();

            //고객사, 도착지 콤보박스 바인딩
            CompanyList = new List <CompanyVO>();

            try
            {
                //datagridview
                SetDataGrid();

                CompanyList = service.GetCompanyAll("cooperative");
                ComboUtil.ComboBinding(cboCompany, CompanyList, "company_code", "company_name", "선택");

                //DestinationList = new List<CompanyVO>();
                //DestinationList = service.GetCompanyAll("cooperative");
                //ComboUtil.ComboBinding(cboDestination, DestinationList, "company_code", "company_name", "선택");
                //조회 버튼
                WhereSoVO vo = new WhereSoVO();
                vo.startDate = dtpStartDate.Value.ToShortDateString();
                vo.endDate   = dtpEndDate.Value.ToShortDateString();

                vo.RegStartDate = dtpRegFirstDate.Value.ToShortDateString();
                vo.RegEndDate   = dtpRegLastDate.Value.ToShortDateString();

                if (cboCompany.Text != "선택")
                {
                    vo.CompanyName = cboCompany.Text;
                }

                try
                {
                    List <SOMasterVO> list = service.GetSOMasterAll(vo);
                    dataGridView1.DataSource = list;
                    SetBottomStatusLabel("조회가 완료되었습니다.");
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                    SetBottomStatusLabel("조회에 실패하였습니다. 다시 시도하여 주십시오.");
                }
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 20
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (dataGridView1.Rows.Count == 0)
            {
                MessageBox.Show("조회 버튼을 먼저 눌러주십시오.", "조회", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            OrderService service = new OrderService();

            if (MessageBox.Show("수요계획을 생성하시겠습니까?", "수요계획생성", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    int resultRow = service.SearchPlanIDInDemand(cbOrderGubun.Text);
                    if (resultRow > 0)
                    {
                        MessageBox.Show("이미 생성된 수요계획이 있습니다.", "수요계획", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    else
                    {
                        List <DemandPlanVO> list = new List <DemandPlanVO>();

                        for (int i = 0; i < somasterList.Count; i++)
                        {
                            DemandPlanVO vo = new DemandPlanVO();
                            vo.plan_id = cbOrderGubun.Text;
                            vo.d_count = somasterList[i].so_pcount;
                            vo.d_date  = somasterList[i].so_edate;
                            vo.so_id   = somasterList[i].so_id;
                            list.Add(vo);
                        }

                        bool result = service.AddDemandPlan(list);

                        if (result)
                        {
                            MessageBox.Show("성공적으로 수요계획을 생성하였습니다.", "수요계획생성", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show("수요계획 생성에 실패하였습니다.", "수요계획생성실패", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                }
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 21
0
        //영업마스터 생성
        private void btnCreatePO_Click(object sender, EventArgs e)
        {
            if (dataGridView1.Rows.Count < 1)
            {
                MessageBox.Show("파일 업로드는 필수입니다.", "파일 업로드", MessageBoxButtons.OK, MessageBoxIcon.Information);
                SetBottomStatusLabel("파일 업로드는 필수입니다.");
            }
            else
            {
                if (MessageBox.Show("영업마스터를 생성하시겠습니까?", "영업마스터생성", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        List <SOMasterVO> list = new List <SOMasterVO>();

                        for (int i = 0; i < dataGridView1.Rows.Count; i++)
                        {
                            SOMasterVO vo = new SOMasterVO();
                            vo.plan_id      = versionName;
                            vo.so_wo_id     = dataGridView1.Rows[i].Cells[2].Value.ToString();
                            vo.so_pcount    = Convert.ToInt32(dataGridView1.Rows[i].Cells[7].Value);
                            vo.company_code = dataGridView1.Rows[i].Cells[3].Value.ToString();
                            vo.so_edate     = dataGridView1.Rows[i].Cells[8].Value.ToString();
                            vo.so_sdate     = dataGridView1.Rows[i].Cells[0].Value.ToString();
                            vo.product_name = dataGridView1.Rows[i].Cells[6].Value.ToString();
                            list.Add(vo);
                        }

                        //DB
                        OrderService service = new OrderService();
                        bool         result  = service.AddSOMaster(list);

                        if (result)
                        {
                            Form fc  = Application.OpenForms["Main"];
                            Main frm = (Main)fc;
                            frm.CloseandOpenTab("영업마스터");
                        }
                        else
                        {
                            MessageBox.Show("영업마스터 생성에 실패하였습니다. 다시 시도하여주십시오.", "영업마스터 생성 실패", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            SetBottomStatusLabel("영업마스터 생성에 실패하였습니다. 다시 시도하여주십시오.");
                            return;
                        }
                    }
                    catch (Exception err)
                    {
                        LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                    }
                }
                else
                {
                    return;
                }
            }
        }
Ejemplo n.º 22
0
        private void MaterialStockList_Load(object sender, EventArgs e)
        {
            StockService service = new StockService();

            try
            {
                //품목유형 콤보박스 바인딩
                List <CommonVO> productTypeList = new List <CommonVO>();
                productTypeList = service.GetProductType("item_type");
                ComboUtil.ComboBinding(cboProductType, productTypeList, "common_value", "common_name", "선택");

                List <FactoryComboVO> factoryList = new List <FactoryComboVO>();
                factoryList = service.GetFactory();
                ComboUtil.ComboBinding(cboFactory, factoryList, "factory_code", "factory_name", "선택");
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }

            SetLoad();

            SetDataGrid();
            //조회버튼
            try
            {
                MaterialStockVO vo = new MaterialStockVO();

                if (txtProductCode.Text != "")
                {
                    vo.product_codename = txtProductCode.Text;
                }

                if (cboProductType.Text != "선택")
                {
                    vo.product_type = cboProductType.Text;
                }

                if (cboFactory.Text != "선택")
                {
                    vo.factory_code = cboFactory.SelectedValue.ToString();
                }

                DataTable dt = service.GetMaterialStockList(vo);
                SetDataGrid();
                dataGridView1.DataSource = dt;
                // SetRowNumber();

                //dataGridView1.Columns[6].DefaultCellStyle.BackColor = Color.Red;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
 private void button5_Click(object sender, EventArgs e)
 {
     try
     {
         ExcelEX(dataGridView1);
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Ejemplo n.º 24
0
 private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         lblID.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString();
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Ejemplo n.º 25
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //입고처리 버튼
            //order_state = P_COMPLETE 로 바꾸고
            //warehouse에 insert
            //

            List <MaterialReceivingVO> list = new List <MaterialReceivingVO>();

            foreach (DataGridViewRow row in dgvMaterialReceiving.Rows)
            {
                bool isCellChecked = Convert.ToBoolean(row.Cells["chk"].EditedFormattedValue);
                if (isCellChecked)
                {
                    MaterialReceivingVO vo = new MaterialReceivingVO();
                    vo.order_serial     = row.Cells[1].Value.ToString();
                    vo.product_codename = row.Cells[4].Value.ToString();
                    vo.order_count      = Convert.ToInt32(row.Cells[7].Value);
                    vo.order_pdate      = row.Cells[8].Value.ToString().Trim();
                    vo.product_name     = row.Cells[5].Value.ToString().Trim();
                    vo.order_sdate      = row.Cells[8].Value.ToString().Trim();

                    list.Add(vo);
                }
            }

            if (MessageBox.Show("입고처리하시겠습니까?", "입고처리", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    MaterialLedgerService service = new MaterialLedgerService();
                    bool result = service.AddMaterialQauntity(list);

                    if (result)
                    {
                        MessageBox.Show("성공적으로 입고처리가 완료되었습니다.", "입고처리", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        dgvMaterialReceiving.Rows.Clear();
                    }
                    else
                    {
                        MessageBox.Show("입고처리 실패하였습니다. 다시 시도하여 주십시오.", "입고처리", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                }
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 26
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                //콤보박스 미선택
                if (cboSearchFacilityGroup.SelectedIndex == 0)
                {
                    var fine = (from findCode in list
                                where findCode.factory_code.Contains(txtSearchFacility.Text) || findCode.factory_name.Contains(txtSearchFacility.Text)

                                select findCode).ToList();
                    dataGridView1.DataSource = fine;
                }
                //콤보박스 선택 텍스트 미입력
                else if (cboSearchFacilityGroup.SelectedIndex != 0 && txtSearchFacility.Text == "")
                {
                    var fine = (from findCode in list
                                where findCode.facility_class.Contains(cboSearchFacilityGroup.Text)
                                select findCode).ToList();
                    dataGridView1.DataSource = fine;
                }
                //콤보박스 텍스트 모두입력
                else
                {
                    var fine = (from findCode in list
                                where (findCode.factory_code.Contains(txtSearchFacility.Text) ||
                                       findCode.factory_name.Contains(txtSearchFacility.Text)) &&
                                findCode.facility_class.Contains(cboSearchFacilityGroup.Text)
                                select findCode).ToList();
                    dataGridView1.DataSource = fine;
                }
                if (dataGridView1.Rows.Count < 1)
                {
                    SetBottomStatusLabel("검색 결과가 없습니다");
                }
                dataGridView1.CurrentCell = null;

                if (dataGridView1.Rows.Count <= 0)
                {
                    SetBottomStatusLabel("조회에 실패하였습니다. 다시 시도하여 주십시오.");
                }
                else
                {
                    SetBottomStatusLabel("조회가 완료되었습니다.");
                }
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 27
0
        private void DataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            uphCount = 0;

            try
            {
                string planID = cbOrderGubun.Text;

                OrderService service = new OrderService();
                uphCount = service.GetMaxUPHCount(planID);

                //수량 입력하면 하루생산량 체크
                if (Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value) > uphCount)
                {
                    MessageBox.Show("일 최대 생산량을 초과하였습니다. 다시 입력하여 주십시오.", "생산계획", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    dataGridView1.Rows[e.RowIndex].Cells[0].Value = null;
                    return;
                }
                //else
                //{


                //if (Convert.ToInt32(lblCount.Text) == 0)
                //{
                //    dataGridView1.Rows[e.RowIndex].Cells[0].Value = null;
                //    return;
                //}
                //else
                //{
                //    TotalCount -= Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value);

                //    if (TotalCount < 0)
                //    {
                //        MessageBox.Show("계획수량을 초과하였습니다. 다시 입력하여 주십시오.");

                //        TotalCount += Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells[0].Value);
                //        dataGridView1.Rows[e.RowIndex].Cells[0].Value = null;
                //        return;
                //    }
                //    else
                //    {
                //        lblCount.Text = TotalCount.ToString();
                //    }
                //}
                //}
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 28
0
        private void BtnCancel_Click(object sender, EventArgs e)
        {
            //입고취소 버튼
            List <MaterialReceivingVO> list = new List <MaterialReceivingVO>();

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                bool isCellChecked = Convert.ToBoolean(row.Cells["chk"].EditedFormattedValue);
                if (isCellChecked)
                {
                    MaterialReceivingVO vo = new MaterialReceivingVO();
                    vo.order_serial     = row.Cells[1].Value.ToString();
                    vo.product_codename = row.Cells[4].Value.ToString();
                    vo.order_count      = Convert.ToInt32(row.Cells[7].Value);
                    vo.product_name     = row.Cells[5].Value.ToString();

                    list.Add(vo);
                }
            }

            MaterialLedgerService service = new MaterialLedgerService();

            if (MessageBox.Show("입고 취소하시겠습니까?", "입고취소", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    bool result = service.CancelMaterial(list);

                    if (result)
                    {
                        MessageBox.Show("성공적으로 입고취소가 완료되었습니다.", "입고취소", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        SetBottomStatusLabel("성공적으로 입고취소가 완료되었습니다.");
                        btnSearch.PerformClick();
                    }
                    else
                    {
                        MessageBox.Show("입고취소 실패하였습니다. 다시 시도하여 주십시오.", "입고취소", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        SetBottomStatusLabel("입고취소 실패하였습니다. 다시 시도하여 주십시오.");
                    }
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                }
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 29
0
        private void InOutList_Load(object sender, EventArgs e)
        {
            try
            {
                //창고 콤보박스 바인딩
                StockService          service = new StockService();
                List <FactoryComboVO> fList   = new List <FactoryComboVO>();
                fList = service.GetFactory();
                ComboUtil.ComboBinding(cboFactory, fList, "factory_code", "factory_name", "선택");

                //품목유형 콤보박스 바인딩
                List <CommonVO> productTypeList = new List <CommonVO>();
                productTypeList = service.GetProductType("item_type");
                ComboUtil.ComboBinding(cboProductType, productTypeList, "common_value", "common_name", "선택");
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }

            SetLoad();
            try
            {
                MaterialSearchVO vo = new MaterialSearchVO();
                vo.startDate = dtpStartDate.Value.ToShortDateString();
                vo.endDate   = dtpEndDate.Value.ToShortDateString();

                if (cboFactory.Text != "선택")
                {
                    vo.factory_name = cboFactory.Text;
                }
                if (cboProductType.Text != "선택")
                {
                    vo.product_type = cboProductType.Text;
                }
                if (txtProduct.Text != "")
                {
                    vo.product_name = txtProduct.Text;
                }

                StockService service = new StockService();
                DataTable    dt      = service.GetInOutHistory(vo);
                SetDataGrid();
                dataGridView1.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Ejemplo n.º 30
0
        private void BtnCancel_Click(object sender, EventArgs e)
        {
            List <OrderVO> list = new List <OrderVO>();

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                bool isCellChecked = Convert.ToBoolean(row.Cells["chk"].EditedFormattedValue);
                if (isCellChecked)
                {
                    OrderVO vo = new OrderVO();
                    vo.order_id    = row.Cells[1].Value.ToString();
                    vo.plan_id     = row.Cells[2].Value.ToString();
                    vo.order_count = Convert.ToInt32(row.Cells[9].Value);

                    list.Add(vo);
                }
            }

            //발주취소 버튼 (발주번호, PlanID 값)
            PurchasingService service = new PurchasingService();

            if (MessageBox.Show("발주 취소하시겠습니까?", "발주취소", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    bool result = service.UpdateOrder(list);

                    if (result)
                    {
                        MessageBox.Show("성공적으로 발주취소가 완료되었습니다.", "발주취소", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        SetBottomStatusLabel("성공적으로 발주취소가 완료되었습니다.");
                        btnSearch.PerformClick();
                    }
                    else
                    {
                        MessageBox.Show("발주취소 실패하였습니다. 다시 시도하여 주십시오.", "발주취소", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        SetBottomStatusLabel("발주취소 실패하였습니다. 다시 시도하여 주십시오.");
                    }
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                }
            }
            else
            {
                return;
            }
        }