private int makeSEQ() { Cnpgsql qry = new Cnpgsql(); NpgsqlCommand qryCommand = new NpgsqlCommand(); string sql = $" select to_char(count(*) +1, 'FM0000000000') cnt" + $" from prj01m00"; qryCommand.CommandText = sql; qry.SetSelect(qryCommand); try { DataTable dt = qry.Select(); m_Seq = dt.Rows[0]["cnt"].ToString(); } catch (Exception ex) { itemErrMsg.Caption = ex.Message; return(-1); } return(0); }
/// <summary> /// 발주처 담당자 정보를 조회한다. /// </summary> public void QueryClientIDInfo() { Cnpgsql Qry = new Cnpgsql(); NpgsqlCommand QryCommander = new NpgsqlCommand(); string sql = $" select client_id" + $" , client_id_nm" + $" from client01t00" + $" where client_cd like '%'|| :p_client_cd ||'%'"; QryCommander.CommandText = sql; QryCommander.Parameters.AddWithValue("p_client_cd", lookupClient.GetColumnValue("client_cd").ToString()); Qry.SetSelect(QryCommander); try { DataTable dt = Qry.Select(); lookupClientID.Properties.DataSource = dt; } catch (Exception ex) { itemErrMsg.Caption = ex.Message; return; } /* * * CHeader Header = new CHeader(UserInfo.UserID, "A0201A", "XtraNewProject", "00000", ""); * * DataTable data = new DataTable("clientInfo"); * * DataColumn colClientCd = new DataColumn("client_cd", typeof(string)); * * data.Columns.Add(colClientCd); * * * * * DataRow Dr = data.NewRow(); * Dr["client_cd"] = lookupClient.GetColumnValue("client_cd"); * * data.Rows.Add(Dr); * * CParam Param = new CParam(data); * * DataSet ds = CTransfer.QryData(Header, Param.GetDataSet()); * * DataTable Dt = ds.Tables["eror_dt"]; * itemErrCd.Caption = Dt.Rows[0]["err_cd"].ToString(); * itemErrMsg.Caption = Dt.Rows[0]["err_msg"].ToString(); * * DataTable Data = ds.Tables["Table"]; * lookupClientID.Properties.DataSource = Data; * */ }
public void QueryClientInfo() { Cnpgsql Qry = new Cnpgsql(); NpgsqlCommand QryCommander = new NpgsqlCommand(); string sql = $" select client_cd" + $" , client_nm" + $" from client01m00"; QryCommander.CommandText = sql; Qry.SetSelect(QryCommander); try { DataTable dt = Qry.Select(); lookupClient.Properties.DataSource = dt; } catch (Exception ex) { itemErrMsg.Caption = ex.Message; return; } /* * * // 로그인 정보를 처리한다. * CHeader Header = new CHeader(UserInfo.UserID, "A0200A", "XtraNewProject", "00000", ""); * * * CParam Param = new CParam(); * * * //refHighTops.HighTopsSoapClient aaa = new refHighTops.HighTopsSoapClient(); * DataSet ds = CTransfer.QryData(Header, Param.GetDataSet()); * * DataTable Dt = ds.Tables["eror_dt"]; * itemErrCd.Caption = Dt.Rows[0]["err_cd"].ToString(); * itemErrMsg.Caption = Dt.Rows[0]["err_msg"].ToString(); * * DataTable Data = ds.Tables["Table"]; * lookupClient.Properties.DataSource = Data; * * */ }
private int chkData() { Cnpgsql Qry = new Cnpgsql(); NpgsqlCommand cmd_select = new NpgsqlCommand(); string sql = $" select count(*) cnt" + $" from prj01m00" + $" where trim(project_nm) = trim(:p_project_nm)"; cmd_select.CommandText = sql; cmd_select.Parameters.AddWithValue("p_project_nm", edtProjectNm.Text); Qry.SetSelect(cmd_select); try { DataTable dt = Qry.Select(); if (Convert.ToInt32(dt.Rows[0]["cnt"].ToString()) != 0) { itemErrMsg.Caption = "동일한 프로젝트명이 존재합니다."; return(-1); } else { } } catch (Exception ex) { itemErrMsg.Caption = ex.Message; throw; } return(0); }
/// <summary> /// 프로젝트 리스트를 조회한다. /// </summary> private void QryFileList() { Cnpgsql Qry = new Cnpgsql(); string sql = $" select file_name" + $" , description" + $" , work_date" + $" , work_user" + $" , file" + $" , 'DWONLOAD' " + $" from file01m00" + $" where file_name like '%' || :p_file_name || '%' "; NpgsqlCommand QryCommander = new NpgsqlCommand(); QryCommander.CommandText = sql; QryCommander.Parameters.AddWithValue("p_file_name", edtFileNm.Text); Qry.SetSelect(QryCommander); try { DataTable dt = Qry.Select(); gridControl1.DataSource = dt; } catch (Exception ex) { itemErrMsg.Caption = ex.Message; } /* * * CHeader Header = new CHeader(UserInfo.UserID, "A0002A", "XtraPLHFile", "00000", ""); * * * dsFile.Tables["tbl_file"].Clear(); * * DataRow Dr = dsFile.Tables["tbl_file"].NewRow(); * Dr["file_name"] = edtFileNm.Text; * * * dsFile.Tables["tbl_file"].Rows.Add(Dr); * * CParam Param = new CParam(dsFile.Tables["tbl_file"]); * * DataSet ds = CTransfer.QryData(Header, Param.GetDataSet()); * * DataTable Dt = ds.Tables["eror_dt"]; * itemErrCd.Caption = Dt.Rows[0]["err_cd"].ToString(); * itemErrMsg.Caption = Dt.Rows[0]["err_msg"].ToString(); * * if (SetStatus(ds) == true) * { * DataTable Data = ds.Tables["Table"]; * gridControl1.DataSource = Data; * } * * * */ }
private int QryData() { string sql = $" select user_id" + $" , user_nm" + $" from usr01m00" + $" where user_id = :p_user_id " + $" and pswd = :p_pswd "; SqlUserCheck.CommandText = sql; Cnpgsql npgsql = new Cnpgsql(); SqlUserCheck.Parameters.AddWithValue("p_user_id", edtUserId.Text); SqlUserCheck.Parameters.AddWithValue("p_pswd", edtPswd.Text); npgsql.SetSelect(SqlUserCheck); DataTable dt = npgsql.Select(); if (dt is null) { return(-1); } return(0); /* * * * // 로그인 정보를 처리한다. * CHeader Header = new CHeader("test", "A0001A", "LOGIN", "00000", ""); * * * DataTable data = new DataTable("LoginInfo"); * * DataColumn colUserId = new DataColumn("user_id", typeof(string)); * DataColumn colPswd = new DataColumn("pswd", typeof(string)); * * data.Columns.Add(colUserId); * data.Columns.Add(colPswd); * * * DataRow Dr = data.NewRow(); * Dr["user_id"] = edtUserId.Text; * Dr["pswd"] = edtPswd.Text; * * data.Rows.Add(Dr); * * CParam Param = new CParam(data); * * //wcfHighTop.HighTopsSoapClient aaa = new refHighTops.HighTopsSoapClient(); * DataSet ds = CTransfer.QryData(Header, Param.GetDataSet()); * * * DataTable Dt = ds.Tables["eror_dt"]; * itemErrCd.Caption = Dt.Rows[0]["err_cd"].ToString(); * itemErrMsg.Caption = Dt.Rows[0]["err_msg"].ToString(); * * if (Dt.Rows[0]["err_cd"].ToString().PadRight(5, ' ') != "00000") * { * return -1; * } * * return 0; * */ }
/// <summary> /// 서버에서 PLH 정보를 LOAD 한다. /// </summary> public void QryPLH() { Cnpgsql Qry = new Cnpgsql(); NpgsqlCommand qryCommand = new NpgsqlCommand(); string sql; sql = $" select a.* " + $" ,get_pavement('1', project_cd, key, order_seq, filename) pavement_stat " + $" ,get_pavement('2', project_cd, key, order_seq, filename) pavement_stat_nm " + $" , 'false' as check " + $" from plh01m00 a " + $" where project_cd = :p_project_cd " + $" order by a.order_seq; "; qryCommand.CommandText = sql; qryCommand.Parameters.AddWithValue("p_project_cd", ProjectInfo.ProjectCD); Qry.SetSelect(qryCommand); try { DataTable dt = Qry.Select(); gridControl1.DataSource = dt; } catch (Exception ex) { itemErrMsg.Caption = ex.Message; //throw; } /* * * CHeader Header = new CHeader(UserInfo.UserID, "A1002A", "XtraPLH", "00000", ""); * * * * DataTable Data = new DataTable("PlhInfo"); * DataColumn colProjectCd = new DataColumn("project_cd", typeof(string)); * * * Data.Columns.Add(colProjectCd); * * * * DataRow Dr = Data.NewRow(); * Dr["project_cd"] = ProjectInfo.ProjectCD; * * Data.Rows.Add(Dr); * * //Project 정보를 담은 ... * CParam Param = new CParam(Data); * * * using (DataSet ds = CTransfer.QryData(Header, Param.GetDataSet())) * { * * DataTable Dt = ds.Tables["eror_dt"]; * itemErrCd.Caption = Dt.Rows[0]["err_cd"].ToString(); * itemErrMsg.Caption = Dt.Rows[0]["err_msg"].ToString(); * * DataTable rcvData = ds.Tables["Table"]; * gridControl1.DataSource = rcvData; * * } * */ }