/// <summary> /// Code Master를 가져옵니다. /// </summary> /// <param name="pCodeValue">대구분 코드</param> /// <param name="codeValue">소구분 코드</param> /// <returns></returns> /// <remarks> /// 2009-01-12 최초생성 : 황준혁 /// 변경내역 /// /// </remarks> public static DataTable GetInspCode(string pCodeValue, string codeValue) { DataTable dt = null; using (WsBiz wb = new WsBiz(AppConfig.MESDB)) { string query = "dbo.usp_MdInspCode_CRUD"; string[] paramList = new string[] { "@iOp1", "@iOp2", "@pCodeValue" }; object[] valueList = new object[] { "R", "3", pCodeValue }; dt = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList).Tables[0]; } return(dt); }
// Common Event 처리 Method #region :: SelectionData :: 조회 처리 Method /// <summary> /// 조회 처리 Method /// </summary> private void SelectionData() { using (var wb = new WsBiz(AppConfig.MESDB)) { DataSet ds; var query = "usp_EqSpare_CRUD"; var paramList = new string[] { "@iOp1 " , "@iOp2 " , "@EqSpareNm " , "@CustNm " , "@EqNm " , "@EqSpareCls1 " , "@DeleteYn " }; var valueList = new object[] { "R" , "1" , String.IsNullOrEmpty(txtEqSpareNm_Search.Text) ? "" : txtEqSpareNm_Search.Text , String.IsNullOrEmpty(txtCustNm_Search.Text) ? "" : txtCustNm_Search.Text , String.IsNullOrEmpty(txtEqNm_Search.Text) ? "" : txtEqNm_Search.Text , mcbEqSpareCls1_Search.EditValue , 0 }; ds = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); grid_get_spare_info.FillGrid(ds); } }
// Common Event 처리 Method #region :: SelectionData :: 조회 처리 Method /// <summary> /// 조회 처리 Method /// </summary> private void SelectionData() { using (var wb = new WsBiz(AppConfig.MESDB)) { DataSet ds; var query = "usp_MdCust_CRUD"; var paramList = new string[] { "@iOp1", "@iOp2", "@CustNm", "@BizNo", "@CustGb", "@UseYn" }; var valueList = new object[] { "R", "1", txt_SLCustNm.Text, txt_SLBizNo.Text, cmb_SLCustGb.EditValue, 1 }; ds = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); gridGetCustInfo.FillGrid(ds); } }
// Common Event 처리 Method #region :: SelectionData :: 조회 처리 Method /// <summary> /// 조회 처리 Method /// </summary> private void SelectionData() { DataSet ds = null; using (var wb = new WsBiz(AppConfig.MESDB)) { var query = "dbo.usp_EqChecklist_CRUD"; var paramList = new string[] { "iOp1", "iOp2", "@CodeValue", "@DisplayValue", }; var valueList = new object[] { "R", "4", Code_Srch.Text, Disp_Srch.Text }; ds = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); View_Master.FillGrid(ds); } }
/////////////////////////////////////////////////////////////////////////////////////////////// // Override(Event, Properties, Method...) /////////////////////////////////////////////////////////////////////////////////////////////// #region :: OnActivated :: Form이 Activate 될 때 발생합니다. /// <summary> /// Form이 Activate 될 때 발생합니다. /// </summary> /// <param name="e"></param> protected override void OnActivated(EventArgs e) { if (MdiParent as MainFrame == null) { return; } (MdiParent as MainFrame).DelCustomButton(); base.OnActivated(e); SetRibbonBarButtonEnabled(); DataSet ds; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = "dbo.MenuBtnList_Select"; string[] paramList = new string[] { "@MenuId" }; object[] valueList = new object[] { MenuID }; ds = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList); } (MdiParent as MainFrame).AddCustomButton(ds); }
/// <summary> /// Code Master를 가져옵니다. /// </summary> /// <param name="pCodeValue">대구분 코드</param> /// <param name="codeValue">소구분 코드</param> /// <param name="bDispCode">코드표시여부</param> /// <returns></returns> /// <remarks> /// 2009-01-12 최초생성 : 황준혁 /// 변경내역 /// /// </remarks> public static DataTable GetCodeMaster(string pCodeValue, string codeValue, bool bDispCode) { DataTable dt = null; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = "dbo.CodeMaster_Get"; /* * string[] paramList = new string[] { "@PCodeValue", * "@CodeValue", * "@DispCode" * }; * object[] valueList = new object[] { pCodeValue, * codeValue, * bDispCode * }; */ string[] paramList = new string[] { "@PCodeValue", "@CodeValue", }; object[] valueList = new object[] { pCodeValue, codeValue, }; dt = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList).Tables[0]; } return(dt); }
// 기타 Control Event 처리 Method는 아래에 기술하세요. #region :: view_L_PP0321_DoubleClick :: 그리드 더블 클릭 Event private void view_L_PP0321_DoubleClick(object sender, EventArgs e) { try { DataSet dataSet; DataRow dr = viewGetEqEquipmentInfo.GetFocusedDataRow(); using (var wb = new WsBiz(AppConfig.MESDB)) { var query = "dbo.usp_MdEquipment_CRUD"; var paramList = new string[] { "@iOp1" , "@iOp2" , "@EqCd" }; var valueList = new object[] { "R" , "2" , dr["EqCd"] }; dataSet = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); } EqData = dataSet.Tables[0].Rows[0]; DialogResult = DialogResult.OK; } catch (Exception ex) { ExceptionBox.Show(ex); } }
//조회처리 public void SelectionData() { DataSet ds; //메인 댓글 불러오기 #region msSql 기준 소스 using (var wb = new WsBiz(AppConfig.DEFAULTDB)) { var query = "dbo.usp_HelpCommentHs_CRUD"; var paramList = new string[] { "@iOp1" , "@iOp2" , "@MenuID" }; var valueList = new object[] { "R" , "1" , menuid }; ds = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (ds.Tables[0].Rows[i]["IsDelete"].Equals(true)) { ds.Tables[0].Rows[i]["Comment"] = "삭제된 댓글입니다."; } } } CreateUserMenu(ds); #endregion }
// Common Event 처리 Method #region :: SelectionData :: 조회 처리 Method /// <summary> /// 조회 처리 Method /// </summary> private void SelectionData() { try { DataSet ds; using (var wb = new WsBiz(AppConfig.MESDB)) { var query = "usp_MdProcess_CRUD"; var paramList = new string[] { "@iOp1", "@iOp2", "@ProcCd", "@ProcNm", "@ProcGb", "@UseYn" }; var valueList = new object[] { "R" , "1" , txtProcCd_Srch.EditValue , txtProcNm_Srch.EditValue , cmbProcGb_Srch.EditValue , 1 }; ds = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); view_Process.FillGrid(ds); } } catch (Exception ex) { } }
/// <summary> /// Grid DataSource를 가져옵니다. /// </summary> /// <returns></returns> private DataSet GridDataSource() { DataSet ds = null; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { ds = wb.NTx_ExecuteDataSet(_connection, MakeQueryString(), AppConfig.COMMANDTEXT, null, null); } return(ds); }
/// <summary> /// DeliverCode를 가져옵니다. /// </summary> /// <returns></returns> /// <remark> /// 2009-10-22 최초생성 : 김정우(삼성전기) /// </remark> public static DataTable GetDeliverCode() { DataTable dt = null; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = "pmms.DeliverCode_Get"; dt = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTMESDB, query, AppConfig.COMMANDSP, null, null).Tables[0]; } return(dt); }
/// <summary> /// Status를 가져옵니다. /// </summary> /// <returns></returns> /// <remarks> /// 2010-04-26 최초생성 : 김태호(삼성전기) /// </remarks> public static DataTable GetPostStatus() { DataTable dt = null; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = "pmms.PostHistoryStatus"; dt = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTMESDB, query, AppConfig.COMMANDSP, null, null).Tables[0]; } return(dt); }
/// <summary> /// AssemblyID 를 가져옵니다. /// </summary> /// <returns></returns> /// <remarks> /// 2009-01-12 최초생성 : 황준혁 /// 변경내역 /// /// </remarks> public static DataTable GetAssemblyID() { DataTable dt = null; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = "dbo.AssemblyID_Get"; dt = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, null, null).Tables[0]; } return(dt); }
// Common Event 처리 Method #region :: SelectionData :: 조회 처리 Method /// <summary> /// 조회 처리 Method /// </summary> private void SelectionData() { using (var wb = new WsBiz(AppConfig.MESDB)) { var query = "dbo.UserInfo_Select"; var paramList = new string[] { "@UserId", "@UserName", }; var valueList = new object[] { txt_UserId_Srch.EditValue, txt_UserNm_Srch.EditValue }; UserData = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); } gridGetUserInfo.FillGrid(UserData); }
/// <summary> /// 해당공정의 등록되지 않은사내설비를 가져옮니다. /// </summary> /// <param name="nProcessCode">공정코드</param> /// <returns></returns> /// <remarks> /// 2009-10-21 최초생성 유효진 /// </remarks> public static DataTable GetNotPostProcessesStations(string nProcessCode) { DataTable dt = null; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = "pmms.NOTPostStationCode_Get"; string[] paramList = new string[] { "@Value" }; object[] valueList = new object[] { nProcessCode }; dt = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTMESDB, query, AppConfig.COMMANDSP, paramList, valueList).Tables[0]; } return(dt); }
/// <summary> /// 각 Post에 해당되는 ProcessCode를 가져옵니다. /// </summary> /// <param name="post"></param> /// <returns></returns> /// <remark> /// 2009-10-20 최초생성 : 김정우(삼성전기) /// </remark> public static DataTable GetPostProcessCode(int post) { DataTable dt = null; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = "pmms.PostProcessCode_Get"; string[] paramList = new string[] { "@Post" }; object[] valueList = new object[] { post }; dt = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTMESDB, query, AppConfig.COMMANDSP, paramList, valueList).Tables[0]; } return(dt); }
/// <summary> /// 사용자 목록 자겨오기 /// </summary> /// <param name="VendCd"></param> /// <param name="PlantCd"></param> /// <param name="UserId"></param> /// <param name="UserNm"></param> /// <returns></returns> public static DataTable GetUserId(string VendCd, string PlantCd, string UserId, string UserNm) { DataTable dt; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = string.Format("select rtrim(UserId) CodeValue,rtrim(UserId)+' : '+UserName DisplayValue from dbo.UserInfo where Vendor like '{0}%' and PlantCode like '{1}%' and UserId like '{2}%' and UserName like '{3}%' and UseFlag=1 order by UserId " , VendCd.Trim() , PlantCd.Trim() , UserId.Trim() , UserNm.Trim() ); dt = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTDB, query, AppConfig.COMMANDTEXT, null, null).Tables[0]; } return(dt); }
public static DataTable Get_CheckData(string spName, string[] Setparams, object[] SetValues) { DataTable dt = null; using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { string query = spName; string[] param = Setparams; //new string[] { "@AUTHORITY", "@EMPLOYEECODE" }; object[] values = SetValues; //new object[] { values1, values2 }; dt = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTMESDB, query, AppConfig.COMMANDSP, param, values).Tables[0]; } return(dt); }
// Common Event 처리 Method #region :: SelectionData :: 조회 처리 Method /// <summary> /// 조회 처리 Method /// </summary> private void SelectionData() { string chkSearch = "1"; using (var wb = new WsBiz(AppConfig.MESDB)) { DataSet ds; var query = "dbo.usp_MdItem_CRUD"; var paramList = new string[] { "@iOp1" , "@iOp2" , "@CustNm" , "@ItemNo" , "@ItemNm" , "@ItemGB" , "@ItemCls1" , "@ItemCls2" , "@UseYn" }; var valueList = new object[] { "R" , "4" , btnCustNmSearch.EditValue , txtMatNo_Srch.EditValue , txtMatNm_Srch.EditValue , matGBSearch.EditValue , ComboCls1_Srch.EditValue , ComboCls2_Srch.EditValue , chkSearch }; ds = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); gridGetMatInfo.FillGrid(ds); viewGetMatInfo.BestFitColumns(); } }
// Common Event 처리 Method #region :: SelectionData :: 조회 처리 Method /// <summary> /// 조회 처리 Method /// </summary> private void SelectionData() { DataSet ds; using (var wb = new WsBiz(AppConfig.DEFAULTDB)) { var query = "dbo.usp_MdEquipment_CRUD"; var paramList = new string[] { "@iOp1 " , "@iOp2 " , "@EqCd " , "@EqNm " , "@EqCls " , "@PuDt_Start " , "@PuDt_End " , "@UseYN " }; var valueList = new object[] { "R" , "1" , txtEqNo_Srch.EditValue , txtEqNmSearch.EditValue , ComboEqGB_Srch.EditValue , dtPuDt_Search.EditValueFrom == null ? "" : dtPuDt_Search.EditValueFrom , dtPuDt_Search.EditValueTo == null ? "" : dtPuDt_Search.EditValueTo , 1 }; ds = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList); if (ds.Tables[0].Rows.Count <= 0) { NewData(); } gridGetEqEquipmentInfo.FillGrid(ds); viewGetEqEquipmentInfo.BestFitColumns(); } }
//폼실행시 발생 private void helper_test_Load(object sender, EventArgs e) { btn_c_delete.Click += Btn_c_delete_Click; btn_update.Click += Btn_update_Click; btn_comment.Click += Btn_comment_Click; btn_img_c.Click += Btn_img_c_Click; SelectionData(); using (WsBiz wb = new WsBiz(AppConfig.DEFAULTDB)) { DataSet ds; string query = "dbo.MenuMaster_File_Select"; var paramList = new string[] { "@iMenuId" }; var valueList = new object[] { menuid }; ds = wb.NTx_ExecuteDataSet(AppConfig.DEFAULTDB, query, AppConfig.COMMANDSP, paramList, valueList); if (ds.Tables[0].Rows.Count > 0) { System.Data.DataRow row = ds.Tables[0].Rows[0]; //byte[] byteArray = (byte[])row.ItemArray[0]; if (row[0] != DBNull.Value) { byte[] byteArray = (byte[])row[0]; //File.WriteAllBytes(@"C:\Users\PC\Downloads\test.pdf", byteArray); MemoryStream stream = new MemoryStream(byteArray); pdfViewer1.LoadDocument(stream); } } //using (PdfSharp.Pdf.PdfDocument one = PdfReader.Open(@"C:\\Users\\PC\\Desktop\\hidata_mes\\helpmenual\\pdf.pdf", PdfDocumentOpenMode.Import)) //using (PdfSharp.Pdf.PdfDocument two = PdfReader.Open(@"C:\\Users\\PC\\Desktop\\hidata_mes\\helpmenual\\sample2.pdf", PdfDocumentOpenMode.Import)) //using (PdfSharp.Pdf.PdfDocument outPdf = new PdfSharp.Pdf.PdfDocument()) //{ // CopyPages(one, outPdf); // CopyPages(two, outPdf); // outPdf.Save(@"C:\\Users\\PC\\Desktop\\hidata_mes\\helpmenual\\result.pdf"); //} //void CopyPages(PdfSharp.Pdf.PdfDocument from, PdfSharp.Pdf.PdfDocument to) //{ // for (int i = 0; i < from.PageCount; i++) // { // to.AddPage(from.Pages[i]); // } //} } //setCurrentPage(2); /******************************************************************************/ //SizeF currentPageSize = pdfViewer1.GetPageSize(pdfViewer1.CurrentPageNumber); //float dpi = 110f; //float pageHeightPixel = currentPageSize.Height * dpi; //float topBottomOffset = 40f; //pdfViewer1.ZoomFactor = ((float)pdfViewer1.ClientSize.Height - topBottomOffset) / pageHeightPixel * 100f; /******************************************************************************/ //if (menuid == "Dev_OutPuts2016") //{ // pdfViewer1.CurrentPageNumber = 3; //} //else if (menuid == "Dev_OutPuts2019") //{ // pdfViewer1.CurrentPageNumber = 5; //} }
/////////////////////////////////////////////////////////////////////////////////////////////// // Method(Private) /////////////////////////////////////////////////////////////////////////////////////////////// // Initialize 관련 Method #region :: InitGlobalInstance :: 전역변수 Initialize /// <summary> /// 전역변수 Initialize /// </summary> private void InitGlobalInstance() { try { #region :: 구매처 :: using (var wb = new WsBiz(AppConfig.MESDB)) { DataSet ds; var query = "dbo.usp_MdCust_CRUD"; var paramList = new string[] { "@iOp1 " , "@iOp2 " }; var valueList = new object[] { "R" , "4" }; ds = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); lueCust.DataSource = ds.Tables[0]; lueCust.DisplayMember = "CustNm"; lueCust.ValueMember = "CustSeq"; lueCust.NullText = string.Empty; } #endregion #region :: 사용자 정보 :: using (var wb = new WsBiz(AppConfig.MESDB)) { DataSet ds; var query = "dbo.UserInfo_Select"; var paramList = new string[] { "@UserId", "@UserName", }; var valueList = new object[] { "", "" }; ds = wb.NTx_ExecuteDataSet(AppConfig.MESDB, query, AppConfig.COMMANDSP, paramList, valueList); lueUser.DataSource = ds.Tables[0]; lueUser.DisplayMember = "UserName"; lueUser.ValueMember = "UserId"; lueUser.NullText = string.Empty; } #endregion #region :: 가격 :: spinPrice.Mask.MaskType = MaskType.Numeric; spinPrice.Mask.UseMaskAsDisplayFormat = true; spinPrice.Mask.EditMask = "c"; #endregion } catch (Exception ex) { ExceptionBox.Show(ex); } }