Example #1
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);
            }
        }
        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;
            }
        }
Example #3
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;
            }
        }
Example #4
0
        private void warehouseHistoryPop_Load(object sender, EventArgs e)
        {
            SetDataGrid();

            try
            {
                StockService service = new StockService();
                DataTable    dt      = service.GetMaterialHistory(vo);
                dataGridView1.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #5
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string startDate = DateTime.Now.ToShortDateString();

            OrderService service = new OrderService();

            try
            {
                somasterList             = service.GetSOMaster(cbOrderGubun.Text);
                dataGridView1.DataSource = somasterList;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #6
0
 private void btnAddGroup_Click(object sender, EventArgs e)
 {
     try
     {
         FacilitiesPop group = new FacilitiesPop(FacilitiesPop.EditMode.Input);
         if (group.ShowDialog() == DialogResult.OK)
         {
             LoadData();
             SetBottomStatusLabel("신규 설비군 등록 성공");
         }
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Example #7
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            List <WatingReceivingVO> list = new List <WatingReceivingVO>();

            foreach (DataGridViewRow row in dgvResult.Rows)
            {
                bool isCellChecked = Convert.ToBoolean(row.Cells["chk"].EditedFormattedValue);
                if (isCellChecked)
                {
                    WatingReceivingVO vo = new WatingReceivingVO();
                    vo.order_id    = row.Cells[1].Value.ToString();
                    vo.order_pdate = row.Cells[7].Value.ToString().Trim();
                    vo.order_sdate = row.Cells[8].Value.ToString().Trim();
                    //vo.order_count = Convert.ToInt32(row.Cells[8].Value);

                    list.Add(vo);
                }
            }

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

                    if (result)
                    {
                        MessageBox.Show("성공적으로 입고대기처리가 완료되었습니다.", "입고대기처리", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        dgvResult.Rows.Clear();
                    }
                    else
                    {
                        MessageBox.Show("입고대기처리 실패하였습니다. 다시 시도하여 주십시오.", "입고대기처리", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                catch (Exception err)
                {
                    LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                }
            }
            else
            {
                return;
            }
        }
Example #8
0
        private void DemandPop_Load(object sender, EventArgs e)
        {
            OrderService service = new OrderService();

            try
            {
                List <string> list = service.GetPlanID();

                cbOrderGubun.DataSource = list;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }

            SetDataGrid();
        }
Example #9
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         BORPop frm = new BORPop(BORPop.EditMode.Input);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             LoadData();
             SetBottomStatusLabel("등록 성공");
             MessageBox.Show("등록 성공");
         }
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Example #10
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.RowsDefaultCellStyle.BackColor = Color.FromArgb(240, 240, 240);
                //dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.White;
                dataGridView1.DefaultCellStyle.SelectionBackColor = Color.Gray; //Color.DimGray;
                dataGridView1.DefaultCellStyle.SelectionForeColor = Color.White;

                dataGridView1.DataSource = dt;

                //GridViewUtil.SetDataGridView(dataGridView1);

                SetBottomStatusLabel("조회가 완료되었습니다.");

                for (int i = 0; i < dataGridView1.Rows.Count; i++)
                {
                    if (i % 3 == 2)
                    {
                        dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.LightYellow;
                        dataGridView1.Rows[i].DefaultCellStyle.ForeColor = Color.Red;
                    }
                }
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #11
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            //조회 버튼
            try
            {
                dataGridView1.Columns.Clear();

                string startDate = dtpStartDate.Value.ToShortDateString();
                string endDate   = dtpEndDate.Value.ToShortDateString();
                string planID    = cboPlanID.Text;

                OrderService service = new OrderService();
                DataTable    dt      = service.GetDemandPlan(startDate, endDate, planID);

                dt.Columns[0].ColumnName = "번호";
                dt.Columns[1].ColumnName = "고객사코드";
                dt.Columns[2].ColumnName = "고객사설비";
                dt.Columns[3].ColumnName = "고객사명";
                dt.Columns[4].ColumnName = "고객주문번호";
                dt.Columns[5].ColumnName = "품목";

                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;



                //foreach (DataColumn dc in dt.Columns)
                //{
                //    dc.ColumnName = "dd";
                //}



                dataGridView1.DataSource       = dt;
                dataGridView1.Columns[4].Width = 150;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #12
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         FactoryPop frm = new FactoryPop(FactoryPop.EditMode.Input);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             LoadData();
             SetBottomStatusLabel("성공적으로 등록되었습니다.");
         }
         else
         {
             SetBottomStatusLabel("등록실패.");
         }
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Example #13
0
        private void OrderDialog_Load(object sender, EventArgs e)
        {
            SetDataGridCompany();
            SetDataGridOrdering();

            PurchasingService service = new PurchasingService();

            try
            {
                DataSet ds = service.GetOrderList(planID);
                dgvOrdering.DataSource = ds.Tables[0];
                dgvCompany.DataSource  = ds.Tables[1];
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }


            //SetRowNumber(dgvCompany);
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         List <DMRVO> n_dt = (List <DMRVO>)dataGridView2.DataSource;
         bool         bResult;
         bResult = P_service.tranWH(n_dt);
         if (bResult)
         {
             MessageBox.Show("성공");
         }
         else
         {
             MessageBox.Show("실패");
         }
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Example #15
0
        //엑셀 등록 버튼
        private void btnAddExcel_Click(object sender, EventArgs e)
        {
            SalesMasterDialog frm = new SalesMasterDialog();

            try
            {
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    versionName = frm.PlanVersion;

                    OrderService service = new OrderService();

                    int resultNum = service.GetPlanIDINSOMaster(versionName);

                    if (resultNum > 0)
                    {
                        if (MessageBox.Show("기존 계획기준 버전이 존재합니다. 계속 진행하시겠습니까?", "계획기준버전확인", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            dataGridView1.Columns.Clear();
                            dataGridView1.DataSource = frm.Data;
                            SetBottomStatusLabel("엑셀 업로드가 완료되었습니다.");
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    {
                        dataGridView1.Columns.Clear();
                        dataGridView1.DataSource = frm.Data;
                        SetBottomStatusLabel("엑셀 업로드가 완료되었습니다.");
                    }
                }
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #16
0
        private void btnRefresh_Click(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;

            cboCompany.SelectedIndex = 0;

            OrderService service = new OrderService();

            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("조회에 실패하였습니다. 다시 시도하여 주십시오.");
            }
        }
Example #17
0
        private void DemandPlan_Load(object sender, EventArgs e)
        {
            //GridViewUtil.SetDataGridView(dataGridView1);
            OrderService service = new OrderService();

            try
            {
                List <string> list = service.GetPlanID();

                cboPlanID.DataSource = list;

                dtpEndDate.Value = DateTime.Now.AddMonths(1);

                //DataTable dt = service.GetDemandPlan(dtpStartDate.Value.ToShortDateString(), dtpEndDate.Value.ToShortDateString(), cboPlanID.Text);

                //dataGridView1.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #18
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (lblID.Text == "")
         {
             MessageBox.Show("변경할 업체를 선택해주세요");
             return;
         }
         CompanyPop frm = new CompanyPop(CompanyPop.EditMode.Update, lblID.Text);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             LoadData();
             MessageBox.Show("거래처 정보 수정 성공");
             SetBottomStatusLabel("거래처 정보 수정 성공");
         }
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Example #19
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string id  = txtID.Text;
            string pwd = txtPwd.Text;

            if (txtID.Text == "")
            {
                MessageBox.Show("아이디를 입력하세요.");
                return;
            }
            if (txtPwd.Text == "")
            {
                MessageBox.Show("비밀번호를 입력하세요.");
                return;
            }

            try
            {
                UserService service = new UserService();
                int         result  = service.LoginCheck(id, pwd);

                if (result > 0)
                {
                    Main frm = new Main();
                    frm.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("아이디 또는 비밀번호가 틀렸습니다.", "로그인 실패");
                    return;
                }
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #20
0
        private void WatingReceiving_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);
            }

            SetDataGridWatingReceiving();
            SetDataGridResult();
        }
Example #21
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);

                Excel._Workbook workbook;

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

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

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

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

                SetBottomStatusLabel("양식 다운로드가 완료되었습니다.");
            }
            catch (Exception ex)
            {
                LoggingUtility.GetLoggingUtility(ex.Message, Level.Error);
            }
        }
Example #22
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 (cboCompany.Text != "선택")
                {
                    vo.company_name = cboCompany.Text;
                }
                if (cboFactory.Text != "선택")
                {
                    vo.factory_name = cboFactory.Text;
                }
                if (txtOrderSerial.Text != "")
                {
                    vo.order_serial = txtOrderSerial.Text;
                }
                if (txtProduct.Text != "")
                {
                    vo.product_name = txtProduct.Text;
                }

                //조회 버튼
                MaterialLedgerService service = new MaterialLedgerService();
                DataTable             dt      = service.GetMaterialInList(vo);
                SetDataGrid();
                dataGridView1.DataSource = dt;
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #23
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         if (lblID.Text != "")
         {
             FactoryPop frm = new FactoryPop(FactoryPop.EditMode.Update, lblID.Text);
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 LoadData();
                 SetBottomStatusLabel("성공적으로 수정되었습니다.");
             }
         }
         else
         {
             MessageBox.Show("선택된 창고 정보가 없습니다.");
             SetBottomStatusLabel("선택된 창고 정보가 없습니다.");
         }
     }
     catch (Exception err)
     {
         LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
     }
 }
Example #24
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         lblID1.Text  = dataGridView1.CurrentRow.Cells[0].Value.ToString();
         txtCode.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString();
         txtName.Text = dataGridView1.CurrentRow.Cells[2].Value.ToString();
         if (dataGridView1.CurrentRow.Cells[3].Value.ToString() == "Y")
         {
             radioButton1.Checked = true;
         }
         else if (dataGridView1.CurrentRow.Cells[3].Value.ToString() == "N")
         {
             radioButton2.Checked = true;
         }
         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);
     }
 }
Example #25
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            SetLoad();
            //조회버튼
            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);
            }
        }
Example #26
0
        private void MaterialReceivingList_Load(object sender, EventArgs e)
        {
            try
            {
                //발주업체 콤보박스 바인딩
                OrderService     service     = new OrderService();
                List <CompanyVO> CompanyList = new List <CompanyVO>();
                CompanyList = service.GetCompanyAll("customer");
                ComboUtil.ComboBinding(cboCompany, CompanyList, "company_code", "company_name", "선택");

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

            SetLoad();

            SetDataGrid();
        }
Example #27
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            TotalCount = 0;

            try
            {
                OrderService service = new OrderService();
                lblUPH.Text = service.GetMaxUPHCount(cbOrderGubun.Text).ToString();

                string startDate = DateTime.Now.ToShortDateString();

                demandList = service.GetDemandPlanFromPlanID(cbOrderGubun.Text);

                DateTime dt = Convert.ToDateTime(demandList[0].d_date).AddDays(-1);

                string endDate = dt.ToShortDateString();

                #region
                dayList = service.GetDays(startDate, endDate);          //날짜 리스트
                #endregion

                dataGridView1.DataSource = dayList;

                if (rdoWeekday.Checked) //주중 선택
                {
                    //List<DayVO> weekdayList = (from item in dayList
                    //                       where item.plan_type == "WEEKDAY"
                    //                       select item).ToList();
                    for (int i = 0; i < dayList.Count; i++)
                    {
                        if (dayList[i].plan_type == "WEEKEND")
                        {
                            dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.DarkGray;
                            dataGridView1.Rows[i].ReadOnly = true;
                        }
                    }
                }
                else if (rdoWeekend.Checked) //주말 선택
                {
                    //List<DayVO> weekEndList = (from item in dayList
                    //                       where item.plan_type == "WEEKEND"
                    //                       select item).ToList();
                    for (int i = 0; i < dayList.Count; i++)
                    {
                        if (dayList[i].plan_type == "WEEKEND")
                        {
                            dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.White;
                            dataGridView1.Rows[i].ReadOnly = false;
                        }
                    }
                }

                foreach (DemandPlanVO vo in demandList)
                {
                    TotalCount += vo.d_count;
                }

                lblCount.Text = TotalCount.ToString();
            }

            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #28
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (edit == EditMode.Insert)
            {
                //영업마스터 추가
                string planID = DateTime.Now.ToShortDateString().Replace("-", "") + "_P";

                SOMasterVO vo = new SOMasterVO();
                vo.plan_id  = planID;
                vo.so_wo_id = txtSOWO.Text;

                List <CompanyVO> company = (from item in list
                                            where item.company_code == (string)cbCompany.SelectedValue
                                            select item).ToList();

                vo.company_code = (string)cbCompany.SelectedValue;
                vo.company_type = company[0].company_type;
                vo.product_name = (string)cbProduct.SelectedValue;
                vo.so_pcount    = Convert.ToInt32(txtOrder.Text);
                vo.so_edate     = dtpsDate.Value.ToShortDateString();
                vo.so_sdate     = DateTime.Now.ToShortDateString();
                vo.so_comment   = txtComment.Text;

                OrderService service = new OrderService();


                if (MessageBox.Show("등록하시겠습니까?", "S/O등록", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        bool result = service.AddOneSOMaster(vo);

                        if (result)
                        {
                            DialogResult = DialogResult.OK;
                        }
                        else
                        {
                            MessageBox.Show("등록에 실패하였습니다.");
                        }
                    }
                    catch (Exception err)
                    {
                        LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                    }
                }
                else
                {
                    return;
                }
            }
            else if (edit == EditMode.Update)
            {
                vo.so_id = vo.so_id;

                List <CompanyVO> company = (from item in list
                                            where item.company_code == (string)cbCompany.SelectedValue
                                            select item).ToList();

                vo.company_code     = (string)cbCompany.SelectedValue;
                vo.company_type     = company[0].company_type;
                vo.product_codename = (string)cbProduct.SelectedValue;
                vo.so_pcount        = Convert.ToInt32(txtOrder.Text);
                vo.so_ccount        = Convert.ToInt32(txtCancel.Text);
                vo.so_edate         = dtpsDate.Value.ToShortDateString();
                vo.so_udate         = string.Format("{0:yyyy-MM-dd HH:mm:ss}", today);
                vo.so_comment       = txtComment.Text;
                vo.so_edate         = dtpsDate.Value.ToShortDateString();

                OrderService service = new OrderService();

                if (MessageBox.Show("수정하시겠습니까?", "S/O수정", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        bool result = service.UpdateOneSOMaster(vo);

                        if (result)
                        {
                            MessageBox.Show("수정이 완료되었습니다.");
                            DialogResult = DialogResult.OK;
                        }
                        else
                        {
                            MessageBox.Show("수정에 실패하였습니다.");
                        }
                    }
                    catch (Exception err)
                    {
                        LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                    }
                }
            }
        }
Example #29
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (lblID2.Text == "")
                {
                    SetBottomStatusLabel("선택된 설비가 없습니다");
                    MessageBox.Show("변경할 설비를 선택해주세요");
                    return;
                }
                else
                {
                    if (dataGridView2.Rows.Count > 0)
                    {
                        DataGridViewRow rows = dataGridView2.CurrentRow;
                        MachineVO       VO   = new MachineVO();
                        VO.m_id         = Convert.ToInt32(rows.Cells[0].Value.ToString());
                        VO.mgrade_code  = rows.Cells[2].Value.ToString();
                        VO.mgrade_id    = Convert.ToInt32(rows.Cells[1].Value);
                        VO.m_code       = rows.Cells[3].Value.ToString();
                        VO.m_name       = rows.Cells[4].Value.ToString();
                        VO.m_use_sector = rows.Cells[5].Value.ToString();
                        VO.m_ok_sector  = rows.Cells[6].Value.ToString();

                        if (rows.Cells[7].Value == null)
                        {
                            VO.m_ng_sector = "";
                        }
                        else
                        {
                            VO.m_ng_sector = rows.Cells[7].Value.ToString();
                        }

                        VO.m_yn     = rows.Cells[11].Value.ToString();
                        VO.m_os_yn  = rows.Cells[8].Value.ToString();
                        VO.m_uadmin = rows.Cells[12].Value.ToString();
                        VO.m_udate  = string.Format("{0:yyyy-MM-dd HH:mm:ss}", today);

                        if (rows.Cells[9].Value == null)
                        {
                            VO.m_check = "";
                        }
                        else
                        {
                            VO.m_check = rows.Cells[9].Value.ToString();
                        }
                        VO.m_comment = rows.Cells[10].Value.ToString();

                        FacilitieInfoPop frm = new FacilitieInfoPop(FacilitieInfoPop.EditMode.Update, VO);
                        if (frm.ShowDialog() == DialogResult.OK)
                        {
                            LoadData();
                            SetBottomStatusLabel("설비 정보 수정 성공");
                            MessageBox.Show("설비 정보 수정 성공");
                        }
                    }
                }
            }
            catch (Exception err)
            {
                LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
            }
        }
Example #30
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (edit == EditMode.Insert)
            {
                if (MessageBox.Show("등록하시겠습니까?", "신규등록", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    price_service = new PriceService();
                    PriceInfoVO vo = new PriceInfoVO();

                    vo.product_id    = Convert.ToInt32(cboProduct.SelectedValue);
                    vo.company_id    = Convert.ToInt32(cboCompany.SelectedValue);
                    vo.price_present = Convert.ToDecimal(txtCurrentPrice.Text);
                    vo.price_past    = Convert.ToDecimal(txtBeforePrice.Text);
                    vo.price_sdate   = dtpStartDate.Value.ToString("yyyy-MM-dd");
                    vo.price_edate   = txtEndDate.Text;
                    vo.price_udate   = txtModifyDate.Text;
                    //vo.price_uadmin = txtModifier.Text;
                    vo.price_yn      = cboIsUsed.SelectedValue.ToString();
                    vo.price_comment = txtNote.Text;

                    try
                    {
                        bool bResult = price_service.AddPriceInfo(vo);
                        if (bResult)
                        {
                            if (MessageBox.Show("등록되었습니다.", "등록완료", MessageBoxButtons.OK) == DialogResult.OK)
                            {
                                this.Close();
                            }
                        }
                    }
                    catch (Exception err)
                    {
                        LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                        if (MessageBox.Show("등록에 실패하였습니다.", "등록 실패", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                        {
                            return;
                        }
                    }
                }
            }
            else if (edit == EditMode.Update)
            {
                if (MessageBox.Show("수정하시겠습니까?", "자재 단가 수정", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    price_service = new PriceService();
                    PriceInfoVO vo = new PriceInfoVO();


                    vo.price_id      = this.vo.price_id;
                    vo.product_id    = Convert.ToInt32(cboProduct.SelectedValue);
                    vo.company_id    = Convert.ToInt32(cboCompany.SelectedValue);
                    vo.price_present = Convert.ToDecimal(txtCurrentPrice.Text);
                    vo.price_past    = Convert.ToDecimal(txtBeforePrice.Text);
                    vo.price_sdate   = dtpStartDate.Value.ToString("yyyy-MM-dd");
                    vo.price_edate   = txtEndDate.Text;
                    vo.price_udate   = txtModifyDate.Text;
                    // vo.price_uadmin = txtModifier.Text;
                    vo.price_yn      = cboIsUsed.SelectedValue.ToString();
                    vo.price_comment = txtNote.Text;



                    try
                    {
                        bool bResult = price_service.UpdatePriceInfo(vo);
                        if (bResult)
                        {
                            if (MessageBox.Show("수정되었습니다.", "수정완료", MessageBoxButtons.OK) == DialogResult.OK)
                            {
                                this.Close();
                            }
                        }
                    }
                    catch (Exception err)
                    {
                        LoggingUtility.GetLoggingUtility(err.Message, Level.Error);
                        if (MessageBox.Show("수정에 실패하였습니다.", "수정 실패", MessageBoxButtons.OK, MessageBoxIcon.Error) == DialogResult.OK)
                        {
                            return;
                        }
                    }
                }
            }
        }