本文整理汇总了C#中System.Data.OleDb.OleDbConnection.GetTempDBF方法的典型用法代码示例。如果您正苦于以下问题:C# OleDbConnection.GetTempDBF方法的具体用法?C# OleDbConnection.GetTempDBF怎么用?C# OleDbConnection.GetTempDBF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.OleDb.OleDbConnection
的用法示例。
在下文中一共展示了OleDbConnection.GetTempDBF方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPaygroupAnalysisTable
public static Env.TempDBFPointer GetPaygroupAnalysisTable(OleDbConnection con, IEnumerable<long> paygroups = null)
{
var anal = con.GetTempDBF();
using (var tmpanal = GetPaygroupOverheadAnalysisTable(con, paygroups))
{
con.ExecuteNonQuery("select paygrp, sum(overhead1) as overhead1 from {0} group by paygrp into table {1}"
, tmpanal, anal);
return anal;
}
}
示例2: GetPaygroupOverheadAnalysisTable
public static Env.TempDBFPointer GetPaygroupOverheadAnalysisTable(OleDbConnection con, IEnumerable<long> paygroups = null)
{
var hourly_methods = new int[] { 8, 9, 14, 15, 16 };
var pcnt_methods = new int[] { 1, 2, 6 };
var allowed_methods = hourly_methods.Concat(pcnt_methods).ToArray();
var hourly_methods_list = string.Format("({0})", string.Join(",", hourly_methods.Select(m => m.ToString()).ToArray()));
var pcnt_methods_list = string.Format("({0})", string.Join(",", pcnt_methods.Select(m => m.ToString()).ToArray()));
var allowed_methods_list = string.Format("({0})", string.Join(",", allowed_methods.Select(m => m.ToString()).ToArray()));
var anal = con.GetTempDBF();
using (Env.TempDBFPointer
paygrps = con.BuildRecnumTable(
paygroups == null
? GetAllPaygroups(con)
: paygroups),
tmpanal = con.GetTempDBF()
)
{
// con.ExecuteNonQuery("select recnum as paygrp, 0000000000.0000 as overhead1 from {0} into table {1}", paygrps, anal);
con.ExecuteNonQuery("create table {0} (paygrp n(15) not null, clcnum n(15) not null, overhead1 n(15,4) not null)", tmpanal);
// build our list of clcs to find values for
// - first grab paygroup specific benefits
con.ExecuteNonQuery("insert into {0}"
+ " select p.recnum, b.dednum as clcnum, b.dedrte as overhead1"
+ " from {1} p"
+ " join benfit b on b.paygrp = p.recnum"
+ " join payded on payded.recnum = b.dednum"
+ " where payded.clctyp = 3"
+ " and payded.benovr > 0"
+ " and payded.clcmth in {2}"
, tmpanal, paygrps, allowed_methods_list);
// now grab our non paygrp specific rates
con.ExecuteNonQuery("insert into {0}"
+ " select p.recnum, payded.recnum as clcnum, payded.dftrte as overhead1"
+ " from {1} p"
+ " join payded on payded.clctyp = 3 and payded.clcmth in {2} and payded.benovr = 0 and payded.dftact > 0"
, tmpanal, paygrps, allowed_methods_list);
// update hour pcnt rates to actual overhead
con.ExecuteNonQuery("update anal set anal.overhead1 = anal.overhead1 * paygrp.payrt1 / 100"
+ " from {0} anal"
+ " join paygrp on paygrp.recnum = anal.paygrp"
+ " join payded on payded.recnum = anal.clcnum"
+ " where payded.clcmth in {1}"
, tmpanal, pcnt_methods_list);
// remove state and local taxes
/*
con.ExecuteNonQuery("delete anal from {0} anal"
+ " join payded on payded.recnum = anal.clcnum and payded.taxloc <> 0"
, tmpanal);
con.ExecuteNonQuery("delete anal from {0} anal"
+ " join payded on payded.recnum = anal.clcnum and !isnull(payded.taxste) and !empty(payded.taxste)"
, tmpanal);
*/
// fill out the table
con.ExecuteNonQuery("select anal.paygrp, paygrp.grpnme, anal.clcnum, payded.clcnme, anal.overhead1"
+ " from {0} anal"
+ " join paygrp on paygrp.recnum = anal.paygrp"
+ " join payded on payded.recnum = anal.clcnum"
+ " into table {1}"
, tmpanal, anal);
#if false
// add hourly rates
// - paygrp specific
con.ExecuteNonQuery("select anal.paygrp, payded.recnum as clcnum, sum(nvl(benfit.dedrte,00000000000.0000)) as dedrte"
+ " from {0} anal"
+ " left join benfit on benfit.paygrp = anal.paygrp and anal.clcnum = benfit.dednum"
+ " left join payded on payded.recnum = benfit.dednum"
+ " where payded.clcmth in (8, 9, 14, 15, 16)"
+ " and payded.clctyp = 3"
+ " and payded.benovr > 0"
+ " group by 1"
+ " into table {1}", anal, sums);
con.ExecuteNonQuery("update anal set anal.overhead1 = sums.dedrte"
+ " from {0} anal"
+ " join {1} sums on sums.paygrp = anal.paygrp and anal.clcnum = sums.clcnum"
, anal, sums);
// - nonpaygrp specific
var nonpghourly = con.GetScalar<decimal>("select p.recnum as paygrp, payded.recnum as clcnum, payded.dftrte as dedrte"
+ " from payded"
+ " where payded.clctyp = 3"
+ " and payded.clcmth in (8, 9, 14, 15, 16)"
+ " and payded.benovr = 0");
con.ExecuteNonQuery("update anal set anal.overhead1 = anal.overhead1 + {0} from {1} anal", nonpghourly, anal);
// percentage rates
// - paygrp specific
con.ExecuteNonQuery("select anal.paygrp, sum(benfit.dedrte) as dedrte"
+ " from {0} anal"
+ " join benfit on benfit.paygrp = anal.paygrp"
//.........这里部分代码省略.........