} //cbo.SelectedValue null처리(string) private void ComboBoxBinding() { common_service = new CommonCodeService(); bom_service = new BomService(); codelist = common_service.GetCommonCodeAll(); #region 사용여부cbo List <CommonVO> _cboUseFlag = (from item in codelist where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding(cboIsUsed, _cboUseFlag, "common_value", "common_name", "선택"); List <CommonVO> _cboRequiredPlan = (from item in codelist where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding(cboRequiredPlan, _cboRequiredPlan, "common_value", "common_name"); #endregion #region 품목cbo product_service = new ProductService(); List <ProductVO> product_list = new List <ProductVO>(); product_list = product_service.GetAllProducts(); ComboUtil.ComboBinding(cboProduct, product_list, "product_id", "product_name", "선택"); #endregion #region 상위품목cbo List <BomVO> bom_list = new List <BomVO>(); bom_list = bom_service.GetBomAll(); ComboUtil.ComboBinding(cboParentProduct, bom_list, "product_id", "bom_name", "-"); #endregion }
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 ShiftMain_Load(object sender, EventArgs e) { GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "ID", "s_id", false, 60); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "설비코드", "m_code", true, 80); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "설비명", "m_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "Shift", "common_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "시작시간", "shift_stime", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "완료시간", "shift_etime", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "적용시작일", "shift_sdate", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "적용완료일", "shift_edate", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "사용유무", "shift_yn", true); dataGridView1.AllowUserToAddRows = false; dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; // ShiftService S_service = new ShiftService(); LoadData(); ResourceService R_service = new ResourceService(); List <MachineVO> m_list = R_service.GetMachineAll(); ComboUtil.ComboBinding(cboMachine, m_list, "m_id", "m_name", "미선택"); CommonCodeService C_service = new CommonCodeService(); List <CommonVO> c_list = C_service.GetCommonCodeAll(); var shift_code = (from shift in c_list where shift.common_type == "shift_code" select shift).ToList(); ComboUtil.ComboBinding(cboShift, shift_code, "common_value", "common_name", "전체"); GridViewUtil.SetDataGridView(dataGridView1); }
private void cbofacilitiesGroup_SelectedIndexChanged(object sender, EventArgs e) { if (cboFactoryGrade.SelectedIndex == 3) //창고 { List <FactoryDB_VO> F_list = R_service.GetFactoryAll(); var High = (from H_Item in F_list where H_Item.facility_class != "창고" select H_Item).ToList(); ComboUtil.ComboBinding <FactoryDB_VO>(cboParent, High, "factory_id", "factory_name"); if (mode == EditMode.Update) { cboParent.Text = txtpr.Text; } } else if (cboFactoryGrade.SelectedIndex == 2) //공장 { List <FactoryDB_VO> F_list = R_service.GetFactoryAll(); var High = (from H_Item in F_list where H_Item.facility_class == "회사" select H_Item).ToList(); ComboUtil.ComboBinding <FactoryDB_VO>(cboParent, High, "factory_id", "factory_name"); if (mode == EditMode.Update) { cboParent.Text = txtpr.Text; } } else if (cboFactoryGrade.SelectedIndex == 1) { cboParent.Text = ""; cboParent.DataSource = null; } }
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(); }
private void SODialog_Load(object sender, EventArgs e) { txtOutput.Enabled = false; list = new List <CompanyVO>(); OrderService service = new OrderService(); list = service.GetCompanyAll("cooperative"); ComboUtil.ComboBinding(cbCompany, list, "company_code", "company_name", "선택"); ComboUtil.ComboBinding(cbDestination, list, "company_code", "company_name"); List <ProductVO> pList = new List <ProductVO>(); pList = service.GetProductList(); ComboUtil.ComboBinding(cbProduct, pList, "product_codename", "product_name", "선택"); if (edit == EditMode.Update) { //수정 데이터 바인딩 txtSOWO.Text = vo.so_wo_id; cbProduct.SelectedValue = vo.product_codename; cbCompany.SelectedValue = vo.company_code; dtpsDate.Value = Convert.ToDateTime(vo.so_edate); txtOrder.Text = vo.so_pcount.ToString(); txtOutput.Text = vo.so_ocount.ToString(); txtCancel.Text = vo.so_ccount.ToString(); txtComment.Text = vo.so_comment; } }
private void CboBinding() { OrderService order_service = new OrderService(); ProductService product_service = new ProductService(); CommonCodeService common_service = new CommonCodeService(); #region 발주업체cbo List <CompanyVO> company_list = order_service.GetCompanyAll("COOPERATIVE"); ComboUtil.ComboBinding(cboCompany, company_list, "company_id", "company_name", "선택"); #endregion #region 품목cbo product_service = new ProductService(); List <ProductVO> product_list = new List <ProductVO>(); product_list = product_service.GetAllProducts(); ComboUtil.ComboBinding(cboProduct, product_list, "product_id", "product_name", "선택"); #endregion #region 사용여부 List <CommonVO> codelist = common_service.GetCommonCodeAll(); List <CommonVO> _cboUseFlag = (from item in codelist where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding(cboIsUsed, _cboUseFlag, "common_value", "common_name", "선택"); #endregion }
private void InitControl() { OrderService order_service = new OrderService(); #region 업체cbo List <CompanyVO> company_list = order_service.GetCompanyAll("CUSTOMER"); ComboUtil.ComboBinding(cboCompany, company_list, "company_id", "company_name", "전체"); #endregion price_service = new PriceService(); pricelist = price_service.GetPriceInfo("COOPERATIVE"); dgvMUPM.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; dgvMUPM.Columns.Add("Number", "No."); dgvMUPM.Columns[0].Width = 53; dgvMUPM.Columns[0].Visible = false; #region DGV바인딩 GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "업체", "company_code", true, 170, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "업체명", "company_name", true, 200, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "품목", "product_codename", true, 180, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "품명", "product_name", true, 240, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "단위", "product_unit", true, 100, DataGridViewContentAlignment.MiddleCenter); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "현재단가", "price_present", true, 150, DataGridViewContentAlignment.MiddleRight, true); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "이전단가", "price_past", true, 150, DataGridViewContentAlignment.MiddleRight, true); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "시작일", "price_sdate", true, 150, DataGridViewContentAlignment.MiddleCenter); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "종료일", "price_edate", true, 150, DataGridViewContentAlignment.MiddleCenter); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "비고", "price_comment", true, 170, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToDataGridView(dgvMUPM, "사용유무", "price_yn", true, 100, DataGridViewContentAlignment.MiddleCenter); #endregion GridViewUtil.SetDataGridView(dgvMUPM); dgvMUPM.AutoGenerateColumns = false; dgvMUPM.DataSource = pricelist; }
private void FactoryMgt_Load(object sender, EventArgs e) { this.ImeMode = ImeMode.Hangul; dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "ID", "factory_id", false, 60); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "시설군", "facility_class", true, 80); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "시설구분", "facility_type", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "시설타입", "facility_value", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "시설코드", "factory_code", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "시설명", "factory_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "상위시설", "factory_parent", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "업체명", "company_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "사용유무", "factory_yn", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "수정자", "factory_uadmin", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "수정시간", "factory_udate", true); GridViewUtil.SetDataGridView(dataGridView1); LoadData(); CommonCodeService Common_service = new CommonCodeService(); common_list = Common_service.GetCommonCodeAll(); var mCode = (from item in common_list where item.common_type == "facility_class_id" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboSearchFacilityGroup, mCode, "common_value", "common_name", "미선택"); panel1.Focus(); dataGridView1.CurrentCell = null; dataGridView1.ClearSelection(); }
private void ComboBinding() { common_service = new CommonCodeService(); codelist = common_service.GetCommonCodeAll(); product_service = new ProductService(); List <FactoryDB_VO> f_list = new List <FactoryDB_VO>(); ResourceService resource_service = new ResourceService(); f_list = resource_service.GetFactoryAll(); List <UserVO> user_list = product_service.GetUserAll(); #region 사용여부cbo List <CommonVO> _cboUseFlag = (from item in codelist where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding(cboIsUsed, _cboUseFlag, "common_value", "common_name", "선택"); #endregion #region 품목유형cbo _cboUseFlag = (from item in codelist where item.common_type == "item_type" select item).ToList(); ComboUtil.ComboBinding(cboProductType, _cboUseFlag, "common_value", "common_name", "선택"); #endregion #region 납품업체cbo List <CompanyVO> company_list = new List <CompanyVO>(); OrderService order_service = new OrderService(); company_list = order_service.GetCompanyAll("customer"); ComboUtil.ComboBinding(cboCompany, company_list, "company_code", "company_name", "선택"); #endregion #region 발주업체cbo company_list = order_service.GetCompanyAll("cooperative"); ComboUtil.ComboBinding(cboSupplyCompany, company_list, "company_code", "company_name", "선택"); List <UserVO> user_vo = new List <UserVO>(); #endregion #region 담당자cbo ComboUtil.ComboBinding(cboAdmin, user_list, "user_id", "user_name", "선택"); #endregion #region 입고창고cbo List <FactoryDB_VO> _cboInSector = (from item in f_list where item.facility_value == "FAC200" select item).ToList(); ComboUtil.ComboBinding(cboInSector, _cboInSector, "factory_code", "factory_name", "선택"); #endregion #region 출고창고cbo List <FactoryDB_VO> _cboOutSector = (from item in f_list where item.facility_value == "FAC100" select item).ToList(); ComboUtil.ComboBinding(cboOutSector, _cboOutSector, "factory_code", "factory_name", "선택"); #endregion }
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); } }
private void FacilitieInfoPop_Load(object sender, EventArgs e) { txtModifyTime.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", today); //콤보박스 바인딩 { service = new CommonCodeService(); list = service.GetCommonCodeAll(); { //사용유무 var mCode = (from item in list where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboIsUsed, mCode, "common_value", "common_name"); } { var mCode = (from item in list where item.common_type == "user_flag" select item).ToList(); mCode.Reverse(); ComboUtil.ComboBinding <CommonVO>(cboIsOS, mCode, "common_value", "common_name"); } R_service = new ResourceService(); var Fatory_list = R_service.GetFactoryAll(); var WH1 = (from wh1 in Fatory_list where wh1.facility_class == "창고" select wh1).ToList(); ComboUtil.ComboBinding <FactoryDB_VO>(cboUseWH, WH1, "factory_id", "factory_name", "미선택"); var WH2 = (from wh1 in Fatory_list where wh1.facility_class == "창고" select wh1).ToList(); ComboUtil.ComboBinding <FactoryDB_VO>(cboOkWH, WH2, "factory_id", "factory_name", "미선택"); var WH3 = (from wh1 in Fatory_list where wh1.facility_class == "창고" select wh1).ToList(); ComboUtil.ComboBinding <FactoryDB_VO>(cboNgWH, WH3, "factory_id", "factory_name", "미선택"); } if (mode == EditMode.Update) { MachineVO vo = this.VO; lblID.Text = VO.m_id.ToString(); lblGrCodeID.Text = VO.mgrade_id.ToString(); txtMgrade_code.Text = VO.mgrade_code; txtCodeFacility.Text = VO.m_code; txtNameFacility.Text = VO.m_name; cboUseWH.Text = VO.m_use_sector; cboOkWH.Text = VO.m_ok_sector; cboNgWH.Text = VO.m_ng_sector; cboIsUsed.Text = VO.m_yn; cboIsOS.Text = VO.m_os_yn; txtModifier.Text = VO.m_uadmin; txtModifyTime.Text = VO.m_udate; txtCheck.Text = VO.m_check; txtComment.Text = VO.m_comment; } }
private void DMRMgt_Load(object sender, EventArgs e) { { ResourceService R_survice = new ResourceService(); List <MachineVO> lst = R_survice.GetMachineAll(); ComboUtil.ComboBinding <MachineVO>(comboBox1, lst, "m_id", "m_name", "미선택"); } dataGridView1.RowHeadersVisible = false; dataGridView1.ReadOnly = true; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn(); checkBoxColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; checkBoxColumn.Name = "ck"; checkBoxColumn.HeaderText = "선택"; checkBoxColumn.MinimumWidth = 50; dataGridView1.Columns.Add(checkBoxColumn); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "pro_id", "pro_id", false, 100, DataGridViewContentAlignment.MiddleLeft); //f GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "플랜id", "plan_id", false, 100, DataGridViewContentAlignment.MiddleLeft); //f GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "계획시작일자", "pro_date", true, 100, DataGridViewContentAlignment.MiddleLeft); //f GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, " ", "so_sdate", false, 100, DataGridViewContentAlignment.MiddleLeft); //f GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "설비코드", "m_code", true, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "설비명", "m_name", true, 100, DataGridViewContentAlignment.MiddleLeft); // GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "상태", "pro_state", false, 100, DataGridViewContentAlignment.MiddleLeft); //ff GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "상태", "common_name", true, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "상품코드", "product_codename", true, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "상품명", "producct_name", true, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "소요창고", "m_use_sector", true, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "양품창고", "m_ok_sector", true, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "불량창고", "m_ng_sector", true, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "계획수량", "pro_count", true, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "", "pro_pcount", false, 100, DataGridViewContentAlignment.MiddleLeft); GridViewUtil.AddNewColumnToTextBoxGridView(dataGridView1, "", "pro_mcount", false, 100, DataGridViewContentAlignment.MiddleLeft); DateTime today = DateTime.Now; dateTimePicker1.Value = today.AddDays(-10); dateTimePicker2.Value = today.AddDays(20); ProcessService P_service = new ProcessService(); dt = P_service.GetProductionPlanCheckHis(dateTimePicker1.Value.ToShortDateString(), dateTimePicker2.Value.ToShortDateString()); // dataGridView1.DataSource = DataView dv = dt.DefaultView; DataTable table = new DataTable(); dv.RowFilter = "pro_state = 'COMMAND' "; if (dv.Count > 0) { table = dv.ToTable(); dataGridView1.DataSource = table; } GridViewUtil.SetDataGridView(dataGridView1); }
private void ComboBinding() { common_service = new CommonCodeService(); codelist = common_service.GetCommonCodeAll(); List <CommonVO> _cboUseFlag = (from item in codelist where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding(cboIsUsed, _cboUseFlag, "common_value", "common_name", "선택"); }
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 InitComboBox() { OrderService service = new OrderService(); List <string> list = service.GetPlanID(); // list.Insert(0, ); cboPlanID.DataSource = list; List <MachineVO> lst = R_service.GetMachineAll(); ComboUtil.ComboBinding(cboMachine, lst, "m_id", "m_name", "전체"); }
private void CompanyPop_Load(object sender, EventArgs e) { string udate = string.Format("{0:yyyy-MM-dd HH:mm:ss}", today); txtUdate.Text = udate; service = new CommonCodeService(); common_list = service.GetCommonCodeAll(); { //사용유무 var mCode = (from item in common_list where item.common_type == "vendor_type" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboCompanyType, mCode, "common_value", "common_name", "미선택"); } { //사용유무 var mCode = (from item in common_list where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboYN, mCode, "common_value", "common_name"); } { R_service = new ResourceService(); u_list = R_service.GetUserAll(); ComboUtil.ComboBinding <UserVO>(cboUser, u_list, "user_id", "user_name"); } if (mode == EditMode.Update) { if (lblID.Text != "") { CompanyDB_VO vo = R_service.GetCompanyByID(Convert.ToInt32(lblID.Text)); txtCodeCompany.Text = vo.company_code; txtNameCompany.Text = vo.company_name; cboCompanyType.Text = vo.common_name; txtCEO.Text = vo.company_ceo; txtCnum.Text = vo.company_cnum; txtbtype.Text = vo.company_btype; txtGtype.Text = vo.company_gtype; cboUser.Text = vo.user_name; txtEmail.Text = vo.company_email; txtPhone.Text = vo.company_phone; txtFax.Text = vo.company_fax; cboYN.Text = vo.company_yn; txtAdmin.Text = vo.company_uadmin; txtUdate.Text = udate; txtComment.Text = vo.company_comment; txtOrder_code.Text = vo.company_order_code; } } }
private void SOO_Load(object sender, EventArgs e) { radioButton6.Checked = true; ResourceService R_service = new ResourceService(); CommonCodeService C_service = new CommonCodeService(); List <CommonVO> c_list = C_service.GetCommonCodeAll(); { var list_c = (from item in c_list where item.common_type == "create_work_order" select item).ToList(); ComboUtil.ComboBinding(cboStatus, list_c, "common_value", "common_name", "미선택"); } { var R_list = (from item in R_service.GetFactoryAll() where item.facility_class == "창고" select item).ToList(); ComboUtil.ComboBinding(cboWH, R_list, "factory_id", "factory_name", "미선택"); } { ComboUtil.ComboBinding(cboMachine, R_service.GetMachineAll(), "m_id", "m_name", "미선택"); } dateTimePicker1.Value = today.AddDays(-10); dateTimePicker2.Value = today.AddDays(20); dt = P_service.GetProductionPlanCheckHis(dateTimePicker1.Value.ToShortDateString(), dateTimePicker2.Value.ToShortDateString()); GridViewUtil.SetDataGridView(dataGridView1); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "상품ID", "pro_id", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "투입일", "pro_date", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "지시일", "so_sdate", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "설비코드", "m_code", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "설비명", "m_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "상태", "common_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "상태", "pro_state", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "품목", "product_codename", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "품명", "producct_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "소진창고", "m_use_sector", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "양품창고", "m_ok_sector", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "불량창고", "m_ng_sector", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "계획수량", "pro_count", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "지시수량", "pro_pcount", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "수량", "pro_mcount", true); GridViewUtil.SetDataGridView(dataGridView1); dataGridView1.DataSource = dt; }
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); } }
/// <summary> /// 데이터그리드뷰 콤보박스 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="dgv"></param> /// <param name="HeaderText"></param> /// <param name="list"></param> /// <param name="displayMember"></param> /// <param name="valueMember"></param> /// <param name="visibility"></param> /// <param name="width"></param> /// <param name="textAlign"></param> public static void AddNewColumnToComboGridView <T>(DataGridView dgv, string HeaderText, List <T> list, string displayMember, string valueMember, bool visibility, int width = 100, DataGridViewContentAlignment textAlign = DataGridViewContentAlignment.MiddleLeft) { DataGridViewComboBoxColumn cmb = new DataGridViewComboBoxColumn(); cmb.HeaderText = HeaderText; cmb.Width = width; cmb.Visible = visibility; cmb.DefaultCellStyle.Alignment = textAlign; cmb.DefaultCellStyle.Padding = new Padding(0, 5, 0, 5); cmb.FlatStyle = FlatStyle.Flat; cmb.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton; ComboUtil.GridComboBinding(cmb, list, displayMember, valueMember); dgv.Columns.Add(cmb); }
private void FacilitiesPop_Load(object sender, EventArgs e) { string todayFormat = string.Format("{0:yyyy-MM-dd HH:mm:ss}", today); txtMgrade_udate.Text = todayFormat; service = new CommonCodeService(); list = service.GetCommonCodeAll(); { //사용유무 var mCode = (from item in list where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboYN, mCode, "common_value", "common_name"); } }
private void GOO_Load(object sender, EventArgs e) { CommonCodeService C_service = new CommonCodeService(); List <CommonVO> c_list = C_service.GetCommonCodeAll(); { var list_c = (from item in c_list where item.common_type == "create_work_order" select item).ToList(); ComboUtil.ComboBinding(cboStatus, list_c, "common_value", "common_name", "미선택"); } dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridView1.AllowUserToAddRows = false; dateTimePicker1.Value = DateTime.Now.AddDays(-7); dateTimePicker2.Value = DateTime.Now.AddDays(7); ResourceService R_service = new ResourceService(); List <MachineVO> m_list = R_service.GetMachineAll(); ComboUtil.ComboBinding(cboMachine, m_list, "m_code", "m_name", "미선택"); DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn(); checkBoxColumn.AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells; checkBoxColumn.HeaderText = "선택"; dataGridView1.Columns.Add(checkBoxColumn); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "작업지시번호", "WorkID", true, 60); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "품목", "product_codename", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "품명", "product_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "상태", "common_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "상태", "pro_state", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "설비코드", "m_code", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "설비명", "m_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "계획수량", "pro_count", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "지시수량", "pro_pcount", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "계획시작일", "pro_date", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "마스터ID", "plan_id", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "상품ID", "pro_id", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView1, "소요시간", "use_time", true); GridViewUtil.SetDataGridView(dataGridView1); LoadData(); }
private void BORPop_Load(object sender, EventArgs e) { R_survice = new ResourceService(); #region 콤보박스 바인딩 common_service = new CommonCodeService(); common_list = common_service.GetCommonCodeAll(); { //공정 var mCode = (from item in common_list where item.common_type == "route" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboRoute, mCode, "common_value", "common_name", "미선택"); } { //사용유무 var mCode = (from item in common_list where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboYN, mCode, "common_value", "common_name"); } R_survice = new ResourceService(); List <MachineVO> lst = R_survice.GetMachineAll(); ComboUtil.ComboBinding <MachineVO>(cboM_name, lst, "m_id", "m_name", "미선택"); ProductService product_service = new ProductService(); List <ProductVO> list = product_service.GetAllProducts(); ComboUtil.ComboBinding <ProductVO>(cboP_Name, list, "product_id", "product_name", "미선택"); #endregion if (mode == EditMode.Update) { R_survice = new ResourceService(); vo = R_survice.GetBORByID(Convert.ToInt32(lblID.Text), lblRoute.Text); lblID.Text = vo.bor_id.ToString(); cboP_Name.Text = vo.product_name; cboM_name.Text = vo.m_name; cboYN.Text = vo.bor_yn; cboRoute.Text = vo.common_name; txtComment.Text = vo.bor_comment; txtReadyTime.Text = vo.bor_readytime.ToString(); txtTactTime.Text = vo.bor_tacktime.ToString(); } }
private void FactoryPop_Load(object sender, EventArgs e) { { //콤보박스 업체 바인딩 R_service = new ResourceService(); Company_list = R_service.GetCompanyAll(); var C_Code = (from R_Item in Company_list select R_Item).ToList(); ComboUtil.ComboBinding <CompanyDB_VO>(cboCompany, C_Code, "company_id", "company_name", "미선택"); } service = new CommonCodeService(); Common_list = service.GetCommonCodeAll(); ComboUtil.ComboBinding <CommonVO>(cboFactoryGrade, Combo("facility_class_id"), "common_value", "common_name", "미선택"); ComboUtil.ComboBinding <CommonVO>(cboTypeFactory, Combo("facility_type"), "common_value", "common_name", "미선택"); ComboUtil.ComboBinding <CommonVO>(cboYN, Combo("user_flag2"), "common_value", "common_name"); { if (mode == EditMode.Update) { VO = R_service.GetFactoryByID(Convert.ToInt32(lblID.Text)); string Comapany_Name = (VO.company_name == null) ? "" : VO.company_name.ToString(); txtCodeFactory.Text = VO.factory_code; txtComment.Text = VO.factory_comment; txtUadmin.Text = VO.factory_uadmin; txtUdate.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", today); txtNameFactory.Text = VO.factory_name; cboCompany.Text = Comapany_Name; cboTypeFactory.Text = VO.factory_type; txtpr.Text = VO.factory_parent; cboYN.Text = VO.factory_yn; cboFactoryGrade.Text = VO.factory_grade; } else if (mode == EditMode.Input) { txtUdate.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss}", today); } } }
private void businessMgt_Load(object sender, EventArgs e) { dataGridView2.SelectionMode = DataGridViewSelectionMode.FullRowSelect; GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업체ID", "company_id", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업체코드", "company_code", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업체명", "company_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업체타입", "common_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업체타입", "company_type", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "대표자명", "company_ceo", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "사업자등록번호", "company_cnum", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업종", "company_btype", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업태", "company_gtype", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "담당자", "user_name", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "담당자id", "user_id", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "이메일", "company_email", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "전화번호", "company_phone", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "팩스", "company_fax", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "수정자", "company_uadmin", false); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "수정시간", "company_udate", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업체정보", "company_comment", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "사용유무", "company_yn", true); GridViewUtil.AddNewColumnToDataGridView(dataGridView2, "업체발주코드", "company_order_code", false); GridViewUtil.SetDataGridView(dataGridView2); LoadData(); common_service = new CommonCodeService(); common_list = common_service.GetCommonCodeAll(); { //사용유무 var mCode = (from item in common_list where item.common_type == "vendor_type" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboTypeCompany, mCode, "common_value", "common_name", "미선택"); } }
private void BOR_Load(object sender, EventArgs e) { this.ImeMode = ImeMode.Hangul; GridViewUtil.SetDataGridView(dataGridView1); dgvColumnSet(); LoadData(); dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; // 셀 클릭하면 행 전체가 선택 common_service = new CommonCodeService(); common_list = common_service.GetCommonCodeAll(); { //사용유무 var mCode = (from item in common_list where item.common_type == "route" select item).ToList(); ComboUtil.ComboBinding <CommonVO>(cboProcess, mCode, "common_value", "common_name", "미선택"); } }
private void InitComboBind() { string todayFormat = string.Format("{0:yyyy-MM-dd HH:mm:ss}", today); txtUdate.Text = todayFormat; ResourceService R_service = new ResourceService(); List <MachineVO> m_list = R_service.GetMachineAll(); ComboUtil.ComboBinding(cboM_code, m_list, "m_id", "m_code"); CommonCodeService C_service = new CommonCodeService(); List <CommonVO> c_list = C_service.GetCommonCodeAll(); var shift_code = (from shift in c_list where shift.common_type == "shift_code" select shift).ToList(); ComboUtil.ComboBinding(cboShiftID, shift_code, "common_value", "common_name"); var YN = (from shift in c_list where shift.common_type == "user_flag" select shift).ToList(); ComboUtil.ComboBinding(cboYN, YN, "common_value", "common_name"); }
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(); }
private void ComboBoxBinding() { //TODO 메서드 하나로 모듈화 ProductService product_service = new ProductService(); ResourceService resource_service = new ResourceService(); List <FactoryDB_VO> f_list = new List <FactoryDB_VO>(); common_service = new CommonCodeService(); codelist = common_service.GetCommonCodeAll(); List <UserVO> user_list = product_service.GetUserAll(); List <CommonVO> _cboUnit = (from item in codelist where item.common_type == "item_unit" select item).ToList(); ComboUtil.ComboBinding(cboProductUnit, _cboUnit, "common_value", "common_name", "선택"); List <CommonVO> _cboUseFlag = (from item in codelist where item.common_type == "user_flag" select item).ToList(); ComboUtil.ComboBinding(cboIsUsed, _cboUseFlag, "common_value", "common_name", "선택"); List <CommonVO> _commonlist = (from item in codelist where item.common_type == "item_type" select item).ToList(); ComboUtil.ComboBinding(cboProductType, _commonlist, "common_value", "common_name", "선택"); List <CommonVO> _commonmeastype = (from item in codelist where item.common_type == "meastype" select item).ToList(); ComboUtil.ComboBinding(cboMeasType, _commonmeastype, "common_value", "common_name", "선택"); #region 담당자cbo ComboUtil.ComboBinding(cboAdmin, user_list, "user_id", "user_name", "선택"); #endregion #region 입고창고cbo f_list = resource_service.GetFactoryAll(); List <FactoryDB_VO> _cboInSector = (from item in f_list where item.facility_value == "FAC200" || item.facility_value == "FAC400" select item).ToList(); ComboUtil.ComboBinding(cboInSector, _cboInSector, "factory_code", "factory_name", "선택"); #endregion #region 출고창고cbo List <FactoryDB_VO> _cboOutSector = (from item in f_list where item.facility_value == "FAC100" select item).ToList(); ComboUtil.ComboBinding(cboOutSector, _cboOutSector, "factory_code", "factory_name", "선택"); #endregion #region 발주방식cbo _commonlist = (from item in codelist where item.common_type == "order_method" select item).ToList(); ComboUtil.ComboBinding(cboOrderType, _commonlist, "common_value", "common_name", "선택"); #endregion #region 납품업체cbo List <CompanyVO> company_list = new List <CompanyVO>(); OrderService order_service = new OrderService(); company_list = order_service.GetCompanyAll("COOPERATIVE"); ComboUtil.ComboBinding(cboSupplyCompany, company_list, "company_code", "company_name", "선택"); #endregion #region 발주업체cbo company_list = order_service.GetCompanyAll("CUSTOMER"); ComboUtil.ComboBinding(cboDemandCompany, company_list, "company_code", "company_name", "선택"); List <UserVO> user_vo = new List <UserVO>(); #endregion }