本文整理汇总了C#中System.Text.StringBuilder.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# System.Text.StringBuilder.Clear方法的具体用法?C# System.Text.StringBuilder.Clear怎么用?C# System.Text.StringBuilder.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Text.StringBuilder
的用法示例。
在下文中一共展示了System.Text.StringBuilder.Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCashSelectModel
public SelectModel GetCashSelectModel(int pageIndex, int pageSize, string orderStr, int pledgeApplyId)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "psd.ContractNo desc";
else
select.OrderStr = orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" psd.ContractNo as StockContractNo,psd.Deadline,SUM(Hands) as Hands,bank.BankName as AccountName ");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Fin_PledgeApply pa ");
sb.AppendFormat(" inner join dbo.Fin_PledgeApplyStockDetail psd on pa.PledgeApplyId = psd.PledgeApplyId and psd.DetailStatus ={0} ", (int)Common.StatusEnum.已生效);
sb.Append(" left join NFMT_Basic..Bank bank on pa.FinancingBankId = bank.BankId ");
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" pa.PledgeApplyId ={0} group by psd.ContractNo,psd.Deadline,bank.BankName ", pledgeApplyId);
select.WhereStr = sb.ToString();
return select;
}
示例2: GetSelectModel
public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, string typeName, int status)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "SmsTypeId asc";
else
select.OrderStr = orderStr;
int statusId = (int)Common.StatusTypeEnum.通用状态;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" SmsTypeId,TypeName,ListUrl,ViewUrl,SmsTypeStatus,bd.StatusName ");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Sm_SmsType st ");
sb.AppendFormat(" left join NFMT_Basic.dbo.BDStatusDetail bd on st.SmsTypeStatus = bd.DetailId and bd.StatusId = {0} ", statusId);
select.TableName = sb.ToString();
sb.Clear();
sb.Append(" 1=1 ");
if (!string.IsNullOrEmpty(typeName))
sb.AppendFormat(" and TypeName like '%{0}%' ", typeName);
if (status > 0)
sb.AppendFormat(" and SmsTypeStatus = {0} ", status);
select.WhereStr = sb.ToString();
return select;
}
示例3: GetSelectModel
public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, int splitDocId)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "sd.DetailId asc";
else
select.OrderStr = orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" sd.DetailId,sd.NewRefNo,sd.GrossAmount,sd.NetAmount,sd.UnitId,mu.MUName,sd.AssetId,ass.AssetName,sd.Bundles,sd.BrandId,br.BrandName,sd.PaperNo,sd.PaperHolder,e.Name,sd.CardNo,sd.Memo");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.St_SplitDocDetail sd ");
//sb.Append(" left join dbo.St_StockName sn on sd.NewRefNoId = sn.StockNameId ");
sb.Append(" left join NFMT_Basic.dbo.MeasureUnit mu on sd.UnitId = mu.MUId ");
sb.Append(" left join NFMT_Basic.dbo.Asset ass on sd.AssetId = ass.AssetId ");
sb.Append(" left join NFMT_Basic.dbo.Brand br on sd.BrandId = br.BrandId ");
sb.Append(" left join NFMT_User.dbo.Employee e on sd.PaperHolder = e.EmpId ");
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" sd.SplitDocId = {0} and sd.DetailStatus >= {1} ", splitDocId, (int)Common.StatusEnum.已生效);
select.WhereStr = sb.ToString();
return select;
}
示例4: GetExistsDataRow
/// <summary>
/// DBに存在するかチェック
/// </summary>
public override DataRow[] GetExistsDataRow( string directoryName ,
Text.TextData textData ,
Translate.TranslateText translateText )
{
Text.TextDataStoryDefs tData = (Text.TextDataStoryDefs)textData;
Translate.TranslateTextStoryDefs tText = ( Translate.TranslateTextStoryDefs ) translateText;
var where = new System.Text.StringBuilder();
where.Clear();
if ( directoryName != null )
{
where.Append( String.Format( "{0}='{1}'" ,
ColumnNameDirName ,
this.DoubleSiglQrt( directoryName ) ) );
where.Append( " AND " );
}
where.Append( String.Format( "{0}='{1}'" ,
ColumnNameTitle ,
this.DoubleSiglQrt( tData.Title ) ) );
where.Append( " AND " );
where.Append( String.Format( "{0}='{1}'" ,
ColumnNameNoteText ,
this.DoubleSiglQrt( tText.TextNode.TextTitle ) ) );
where.Append( " AND " );
where.Append( String.Format( "{0}='{1}'" ,
ColumnNameNoteIndex ,
tText.TextNode.TextIndex.ToString() ) );
return this.Select( where.ToString() );
}
示例5: AutoCompleteData
public ActionResult AutoCompleteData(String q)
{
List<Object> data = new List<Object>();
// Generate a consistent seed based on the characters in the query string
int seed = 0;
for (int x = 0; x < q.Length; x++)
{
seed += Convert.ToInt32(q[x]);
}
System.Random random = new System.Random( seed );
// Build 5 random "words" of 8 letters
System.Text.StringBuilder builder = new System.Text.StringBuilder();
for ( int word = 0; word < 5; word++ )
{
char ch;
int mod = 65; // Start with an uppercase letter
for ( int letter = 0; letter < 8; letter++ )
{
ch = Convert.ToChar( Convert.ToInt32( Math.Floor( 26 * random.NextDouble() + mod ) ) );
builder.Append(ch);
mod = 97; // Switch to lowercase
}
data.Add(new { Name = builder.ToString() });
builder.Clear();
}
System.Threading.Thread.Sleep(1000);
return Json(data);
}
示例6: GetSelectModel
public Common.SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr,int priceConfirmId)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "detail.DetailId desc";
else
select.OrderStr = orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("detail.DetailId,detail.PriceConfirmId,detail.InterestStartDate,detail.InterestEndDate,CONVERT(varchar,detail.InterestDay) + '天' as InterestDayName,detail.InterestDay,detail.InterestUnit,CONVERT(varchar,detail.InterestUnit)+mu.MUName as InterestUnitName");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Pri_PriceConfirmDetail detail ");
sb.Append(" left join dbo.Pri_PriceConfirm pc on detail.PriceConfirmId = pc.PriceConfirmId ");
sb.Append(" left join dbo.Con_Contract con on pc.ContractId = con.ContractId ");
sb.Append(" left join NFMT_Basic..MeasureUnit mu on con.UnitId = mu.MUId ");
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" detail.PriceConfirmId = {0} and detail.DetailStatus = {1} ", priceConfirmId, (int)Common.StatusEnum.已生效);
select.WhereStr = sb.ToString();
return select;
}
示例7: GetSelectModelForHand
public SelectModel GetSelectModelForHand(int pageIndex, int pageSize, string orderStr, int pledgeApplyId, int repoApplyId)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "rad.StockDetailId desc";
else
select.OrderStr = orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" rad.DetailId,rad.StockDetailId,rad.RepoTime,rad.ContractNo,rad.StockId,rad.RefNo,pasd.NetAmount as PledgeNetAmount,pasd.Hands as PledgeHands,pasd.Memo,ISNULL(alStock.AlreadyNetAmount,0) as AlreadyNetAmount,ISNULL(alStock.AlreadyHands,0) as AlreadyHands,rad.AccountName,rad.NetAmount,ROUND(rad.NetAmount/ass.AmountPerHand,0) as Hands,rad.Price,rad.ExpiringDate");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Fin_RepoApplyDetail rad ");
sb.Append(" left join dbo.Fin_PledgeApplyStockDetail pasd on rad.StockDetailId = pasd.StockDetailId ");
sb.Append(" left join dbo.Fin_PledgeApply pa on pasd.PledgeApplyId = pa.PledgeApplyId ");
sb.Append(" left join ( ");
sb.Append(" select StockId,SUM(ISNULL(NetAmount,0)) as AlreadyNetAmount,SUM(ISNULL(Hands,0)) as AlreadyHands ");
sb.Append(" from dbo.Fin_RepoApplyDetail ");
sb.AppendFormat(" where DetailStatus >= {0} and RepoApplyId <> {1} ", (int)Common.StatusEnum.已录入, repoApplyId);
sb.Append(" group by StockId ");
sb.Append(" ) alStock on rad.StockId = alStock.StockId ");
sb.Append(" left join NFMT_Basic..Asset ass on ass.AssetId = pa.AssetId ");
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" rad.RepoApplyId = {0} and rad.DetailStatus = {1} ", repoApplyId, (int)Common.StatusEnum.已生效);
select.WhereStr = sb.ToString();
return select;
}
示例8: File2Text
private static void File2Text(string inputFile, string outputFile)
{
var input = System.IO.File.OpenRead(inputFile);
var output = new System.IO.StreamWriter(outputFile);
int off = 0;
byte[] buf = new byte[1024];
var builder = new System.Text.StringBuilder();
int len = input.Read(buf, 0, buf.Length);
while (len > 0)
{
while (off < len)
{
builder.Append(buf[off++].ToString("X2"));
}
output.WriteLine(builder.ToString());
builder.Clear();
off = 0;
len = input.Read(buf, 0, buf.Length);
}
output.Close();
input.Close();
}
示例9: GetSelectModel
public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, DateTime beginDate, DateTime endDate, int bankId, int assetId, int status, string pledgeApplyNo, string refNo)
{
SelectModel select = new SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
select.OrderStr = string.IsNullOrEmpty(orderStr) ? "pa.PledgeApplyId desc" : orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" pa.PledgeApplyId,pa.PledgeApplyNo,pa.ApplyTime,bank.BankName,bacc.AccountNo,ass.AssetName,case pa.SwitchBack when 0 then '否' when 1 then '是' end as SwitchBack,pa.SumNetAmount,pa.SumHands,mu.MUName,pa.PledgeApplyStatus,bd.StatusName,task.NodeName ");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Fin_PledgeApply pa ");
sb.Append(" left join NFMT_Basic..Bank bank on pa.FinancingBankId = bank.BankId ");
sb.Append(" left join NFMT_Basic..BankAccount bacc on pa.FinancingAccountId = bacc.BankAccId ");
sb.Append(" left join NFMT_Basic..Asset ass on pa.AssetId = ass.AssetId ");
sb.Append(" left join NFMT_Basic..MeasureUnit mu on ass.MUId = mu.MUId ");
sb.Append(" left join NFMT_Basic..Exchange ex on pa.ExchangeId = ex.ExchangeId ");
sb.AppendFormat(" left join NFMT_Basic..BDStatusDetail bd on pa.PledgeApplyStatus = bd.DetailId and bd.StatusId = {0} ", (int)Common.StatusTypeEnum.通用状态);
sb.Append(" left join ( ");
sb.Append(" select a.NodeName,a.RowId from ( ");
sb.Append(" select n.NodeName,ds.RowId,row_number() OVER (partition BY ds.RowId ORDER BY t.TaskId desc,ISNULL(tol.LogTime,dateadd(d,1,getdate())) desc,tn.NodeLevel desc) as num ");
sb.Append(" from NFMT_WorkFlow.dbo.Wf_DataSource ds ");
sb.Append(" left join NFMT_WorkFlow.dbo.Wf_Task t on ds.SourceId = t.DataSourceId ");
sb.Append(" left join NFMT_WorkFlow.dbo.Wf_TaskNode tn on t.TaskId = tn.TaskId ");
sb.Append(" left join NFMT_WorkFlow.dbo.Wf_TaskOperateLog tol on tn.TaskNodeId = tol.TaskNodeId ");
sb.Append(" left join NFMT_WorkFlow.dbo.Wf_Node n on tn.NodeId = n.NodeId ");
sb.Append(" where ds.BaseName = 'Financing' ");
sb.Append(" and ds.TableCode = 'dbo.Fin_PledgeApply' ");
sb.AppendFormat(" and (ISNULL(tol.LogId,0)<>0 or tn.NodeStatus>{0}) ", (int)Common.StatusEnum.审核拒绝);
sb.Append(" ) a ");
sb.Append(" where a.num = 1 ");
sb.Append(" ) task on pa.PledgeApplyId = task.RowId ");
select.TableName = sb.ToString();
sb.Clear();
sb.Append(" 1=1 ");
if (beginDate > NFMT.Common.DefaultValue.DefaultTime && endDate > beginDate)
sb.AppendFormat(" and pa.ApplyTime between '{0}' and '{1}' ", beginDate.ToShortDateString(), endDate.ToShortDateString());
if (bankId > 0)
sb.AppendFormat(" and pa.FinancingBankId = {0} ", bankId);
if (assetId > 0)
sb.AppendFormat(" and pa.AssetId = {0} ", assetId);
if (status > 0)
sb.AppendFormat(" and pa.PledgeApplyStatus = {0} ", status);
if (!string.IsNullOrEmpty(pledgeApplyNo))
sb.AppendFormat(" and pa.PledgeApplyNo like '%{0}%' ", pledgeApplyNo);
if (!string.IsNullOrEmpty(refNo))
sb.AppendFormat(" and exists (select 1 from dbo.Fin_PledgeApplyStockDetail where RefNo like '%{0}%' and PledgeApplyId = pa.PledgeApplyId and DetailStatus >={1})", refNo, (int)NFMT.Common.StatusEnum.已生效);
select.WhereStr = sb.ToString();
return select;
}
示例10: GetBankPledgeReportSelect
public SelectModel GetBankPledgeReportSelect(int pageIndex, int pageSize, string orderStr, string refNo, int bankId, DateTime startDate, DateTime endDate, int repoInfo)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "bank.BankName desc";
else
select.OrderStr = orderStr;
int readyStatus = (int)Common.StatusEnum.已生效;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" bank.BankName,pasd.RefNo,pasd.NetAmount,pasd.ContractNo,pa.ApplyTime,pasd.Hands,price.Price,price.ExpiringDate,pasd.NetAmount-ISNULL(repo.NetAmount,0) nowPledgeAmount ");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" Financing.dbo.Fin_PledgeApply pa ");
sb.Append(" left join NFMT_Basic.dbo.Bank bank on pa.FinancingBankId = bank.BankId ");
sb.Append(" inner join Financing.dbo.Fin_PledgeApplyStockDetail pasd on pa.PledgeApplyId = pasd.PledgeApplyId and pasd.DetailStatus >=50 ");
sb.Append(" left join ( ");
sb.Append(" select ROW_NUMBER() OVER(PARTITION BY PledgeApplyId,StockContractNo,Deadline ORDER BY ExpiringDate desc) rowid, PledgeApplyId,Price,ExpiringDate,StockContractNo,Deadline ");
sb.Append(" from Financing.dbo.Fin_PledgeApplyCashDetail ");
sb.Append(" where DetailStatus >=50 ");
sb.Append(" ) price on pasd.ContractNo = price.StockContractNo and pasd.Deadline = price.Deadline and pasd.PledgeApplyId = price.PledgeApplyId and price.rowid = 1 ");
sb.Append(" left join ( ");
sb.Append(" select rad.PledgeApplyId,rad.StockId,SUM(rad.NetAmount) NetAmount ");
sb.Append(" from Financing.dbo.Fin_RepoApplyDetail rad ");
sb.Append(" left join Financing.dbo.Fin_RepoApply ra on rad.RepoApplyId = ra.RepoApplyId ");
sb.Append(" where rad.DetailStatus >=50 and ra.RepoApplyStatus >=50 ");
sb.Append(" group by rad.PledgeApplyId,rad.StockId ");
sb.Append(" ) repo on pasd.PledgeApplyId = repo.PledgeApplyId and pasd.StockId = repo.StockId ");
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" pa.PledgeApplyStatus >= {0} ", readyStatus);
if (bankId > 0)
sb.AppendFormat(" and pa.FinancingBankId = {0} ", bankId);
if (!string.IsNullOrEmpty(refNo))
sb.AppendFormat(" and pasd.RefNo like '%{0}%' ", refNo);
if (startDate > Common.DefaultValue.DefaultTime && endDate > startDate)
sb.AppendFormat(" and pa.ApplyTime between '{0}' and '{1}' ", startDate.ToString(), endDate.AddDays(1).ToString());
if (repoInfo > 0)
{
if (repoInfo == 1)
sb.AppendFormat(" and (pasd.NetAmount-ISNULL(repo.NetAmount,0)) = 0 ");
if(repoInfo == 2)
sb.AppendFormat(" and (pasd.NetAmount-ISNULL(repo.NetAmount,0)) > 0 ");
}
select.WhereStr = sb.ToString();
return select;
}
示例11: GetFundsLogReportSelect
public SelectModel GetFundsLogReportSelect(int pageIndex, int pageSize, string orderStr, DateTime startDate, DateTime endDate,int inCorpId,int outCorpId,int logType)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "fl.FundsLogId desc";
else
select.OrderStr = orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("fl.FundsLogId,fl.LogDate,fl.InCorpId,inCorp.CorpName as InCorpName,fl.InBankId,inBank.BankName as InBankName,fl.InAccountId");
sb.Append(",inAcc.AccountNo as InAccountNo,fl.OutCorpId,outCorp.CorpName as OutCorpName,fl.OutBankId,outBank.BankName as OutBankName");
sb.Append(",fl.OutAccountId,outAcc.AccountNo as OutAccountNo,fl.LogType,lt.DetailName as LogTypeName,cur.CurrencyName");
sb.Append(",fl.FundsBala,fl.IsVirtualPay,fl.PayMode,pm.DetailName as PayModeName");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" NFMT.dbo.Fun_FundsLog fl ");
sb.Append(" left join NFMT_User.dbo.Corporation inCorp on inCorp.CorpId = fl.InCorpId ");
sb.Append(" left join NFMT_Basic.dbo.Bank inBank on inBank.BankId = fl.InBankId ");
sb.Append(" left join NFMT_Basic.dbo.BankAccount inAcc on inAcc.BankAccId = fl.InAccountId ");
sb.Append(" left join NFMT_User.dbo.Corporation outCorp on outCorp.CorpId = fl.OutCorpId ");
sb.Append(" left join NFMT_Basic.dbo.Bank outBank on outBank.BankId = fl.OutBankId ");
sb.Append(" left join NFMT_Basic.dbo.BankAccount outAcc on outAcc.BankAccId = fl.OutAccountId ");
sb.Append(" left join NFMT_Basic.dbo.BDStyleDetail lt on lt.StyleDetailId = fl.LogType ");
sb.Append(" left join NFMT_Basic.dbo.Currency cur on fl.CurrencyId = cur.CurrencyId ");
sb.Append(" left join NFMT_Basic.dbo.BDStyleDetail pm on pm.StyleDetailId = fl.PayMode ");
select.TableName = sb.ToString();
sb.Clear();
sb.Append(" fl.LogStatus>=50 ");
if (startDate > Common.DefaultValue.DefaultTime && endDate > startDate)
sb.AppendFormat(" and fl.LogDate between '{0}' and '{1}' ", startDate.ToString(), endDate.ToString());
if (inCorpId > 0)
sb.AppendFormat(" and fl.InCorpId = {0} ", inCorpId);
if (outCorpId > 0)
sb.AppendFormat(" and fl.OutCorpId = {0} ", outCorpId);
if (logType > 0)
sb.AppendFormat(" and fl.LogType = {0} ", logType);
select.WhereStr = sb.ToString();
return select;
}
示例12: GetSelectModel
public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, int empId)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "detail.DetailId desc";
else
select.OrderStr = orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("detail.DetailId,e.Name,ag.AuthGroupName,");
sb.Append("case when ISNULL(ag.AssetId,0)=0 then '全部' else a.AssetName end as AssetName,");
sb.Append("case when ISNULL(ag.TradeDirection,0)=0 then '全部' else bd1.DetailName end as TradeDirection,");
sb.Append("case when ISNULL(ag.TradeBorder,0)=0 then '全部' else bd2.DetailName end as TradeBorder,");
sb.Append("case when ISNULL(ag.ContractInOut,0)=0 then '全部' else bd3.DetailName end as ContractInOut,");
sb.Append("case when ISNULL(ag.ContractLimit,0)=0 then '全部' else bd4.DetailName end as ContractLimit,");
sb.Append("case when ISNULL(ag.CorpId,0)=0 then '全部' else c.CorpName end as CorpName,bdd.StatusName");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.AuthGroupDetail detail ");
sb.Append(" left join NFMT_User.dbo.Employee e on detail.EmpId = e.EmpId ");
sb.Append(" left join dbo.AuthGroup ag on detail.AuthGroupId = ag.AuthGroupId ");
sb.Append(" left join NFMT_Basic.dbo.Asset a on ag.AssetId = a.AssetId ");
sb.AppendFormat(" left join NFMT_Basic.dbo.BDStyleDetail bd1 on ag.TradeDirection = bd1.StyleDetailId and bd1.BDStyleId = {0} ", (int)NFMT.Data.StyleEnum.TradeDirection);
sb.AppendFormat(" left join NFMT_Basic.dbo.BDStyleDetail bd2 on ag.TradeBorder = bd2.StyleDetailId and bd2.BDStyleId = {0} ", (int)NFMT.Data.StyleEnum.TradeBorder);
sb.AppendFormat(" left join NFMT_Basic.dbo.BDStyleDetail bd3 on ag.ContractInOut = bd3.StyleDetailId and bd3.BDStyleId = {0} ", (int)NFMT.Data.StyleEnum.ContractSide);
sb.AppendFormat(" left join NFMT_Basic.dbo.BDStyleDetail bd4 on ag.ContractLimit = bd4.StyleDetailId and bd4.BDStyleId = {0} ", (int)NFMT.Data.StyleEnum.ContractLimit);
sb.Append(" left join dbo.Corporation c on ag.CorpId = c.CorpId ");
sb.AppendFormat(" left join NFMT_Basic.dbo.BDStatusDetail bdd on detail.DetailStatus = bdd.DetailId and bdd.StatusId = {0} ", (int)NFMT.Common.StatusTypeEnum.通用状态);
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" detail.EmpId = {0} and detail.DetailStatus = {1} ", empId, (int)Common.StatusEnum.已生效);
select.WhereStr = sb.ToString();
return select;
}
示例13: GetSelectModel
public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, int status)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "psd.DetailId desc";
else
select.OrderStr = orderStr;
int statusId = (int)Common.StatusTypeEnum.通用状态;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" psd.DetailId,a.ApplyNo,sub.SubNo,sn.RefNo,CONVERT(varchar,psd.PayBala)+cur.CurrencyName as PayBala,CONVERT(varchar,psd.FundsBala)+cur.CurrencyName as FundsBala,CONVERT(varchar,psd.VirtualBala)+cur.CurrencyName as VirtualBala,bd.StatusName,psd.DetailStatus ");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Fun_PaymentStockDetail psd ");
sb.Append(" left join dbo.Fun_PayApply pa on psd.PayApplyId = pa.PayApplyId ");
sb.Append(" inner join dbo.Apply a on pa.ApplyId = a.ApplyId ");
sb.Append(" left join dbo.Con_ContractSub sub on psd.SubId = sub.SubId ");
sb.Append(" left join dbo.St_Stock st on psd.StockId = st.StockId ");
sb.Append(" left join dbo.St_StockName sn on st.StockNameId = sn.StockNameId ");
sb.Append(" left join dbo.Fun_Payment p on psd.PaymentId = p.PaymentId ");
sb.Append(" left join NFMT_Basic..Currency cur on p.CurrencyId = cur.CurrencyId ");
sb.AppendFormat(" left join NFMT_Basic..BDStatusDetail bd on bd.DetailId = psd.DetailStatus and bd.StatusId = {0} ", statusId);
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" psd.SourceFrom = {0} ", (int)PaymenyAllotTypeEnum.合约付款分配);
if (status > 0)
sb.AppendFormat(" and psd.DetailStatus = {0} ", status);
select.WhereStr = sb.ToString();
return select;
}
示例14: GetExistsDataRow
/// <summary>
/// DBに存在するかチェック
/// </summary>
public override DataRow[] GetExistsDataRow( string directoryName ,
Text.TextData textData ,
Translate.TranslateText translateText )
{
Text.TextDataDepartments tData = ( Text.TextDataDepartments ) textData;
var where = new System.Text.StringBuilder();
where.Clear();
if ( directoryName != null )
{
where.Append( String.Format( "{0}='{1}'" ,
ColumnNameDirName ,
this.DoubleSiglQrt( directoryName ) ) );
where.Append( " AND " );
}
where.Append( String.Format( "{0}='{1}'" ,
ColumnNameName ,
this.DoubleSiglQrt( tData.Name ) ) );
return this.Select( where.ToString() );
}
示例15: GetSelectModel
public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, int empId, int status)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "ra.ReceivableAllotId asc";
else
select.OrderStr = orderStr;
int statusId = (int)Common.StatusTypeEnum.通用状态;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" ra.ReceivableAllotId,ra.AllotTime,ra.AllotDesc,CONVERT(varchar,ra.AllotBala) + c.CurrencyName as AllotBala,e.Name,ra.AllotStatus,bd.StatusName,sub.SubNo ");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Fun_ReceivableAllot ra ");
sb.Append(" left join NFMT_Basic.dbo.Currency c on ra.CurrencyId = c.CurrencyId ");
sb.Append(" left join NFMT_User.dbo.Employee e on ra.EmpId =e.EmpId ");
sb.AppendFormat(" left join NFMT_Basic.dbo.BDStatusDetail bd on ra.AllotStatus = bd.DetailId and StatusId = {0} ", statusId);
sb.Append(" right join (select distinct AllotId,SubContractId from dbo.Fun_CorpFundsAllotContract_Ref ) as ref on ref.AllotId = ra.ReceivableAllotId ");
sb.Append(" left join dbo.Con_ContractSub sub on sub.SubId = ref.SubContractId ");
select.TableName = sb.ToString();
sb.Clear();
sb.Append(" 1=1");
if (status > 0)
sb.AppendFormat(" and ra.AllotStatus = {0} ", status);
if (empId > 0)
sb.AppendFormat(" and ra.EmpId = {0} ", empId);
select.WhereStr = sb.ToString();
return select;
}