本文整理匯總了C#中WSV.DAL.DataBase.PortTransactSql1方法的典型用法代碼示例。如果您正苦於以下問題:C# DataBase.PortTransactSql1方法的具體用法?C# DataBase.PortTransactSql1怎麽用?C# DataBase.PortTransactSql1使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WSV.DAL.DataBase
的用法示例。
在下文中一共展示了DataBase.PortTransactSql1方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AddData
/// <summary>
/// 添加數據
/// </summary>
/// <param name="Item">model</param>
/// <returns></returns>
public static string AddData(Model.Port.PortModel port, int Iport)
{
DataBase db = new DataBase();
DataBaseVisitor visitor = new DAL.Port.PortVisitor();
bool bSuc = false;
int nEffectRows = 0;
//long id = BLL.PublicFun.PublicFun.MaxId("D_Plan");
SqlParameter[] prams ={
//db.MakeInParam("@ID", SqlDbType.BigInt,12, BLL.PublicFun.PublicFun.MaxId("D_Plan")),
db.MakeInParam("@fcustid", SqlDbType.Int,4, port.Fcustid),
db.MakeInParam("@FDeptID", SqlDbType.Int,4, port.FDeptID),
db.MakeInParam("@fitemid", SqlDbType.Int,4, port.Fitemid),
db.MakeInParam("@FUnitID", SqlDbType.Int,4, port.FUnitID),
db.MakeInParam("@FFManagerID", SqlDbType.Int,4, port.FFManagerID),
db.MakeInParam("@FSManagerID", SqlDbType.Int,4, port.FSManagerID),
db.MakeInParam("@FDCStockID", SqlDbType.Int,4, port.FDCStockID),
db.MakeInParam("@fbiller", SqlDbType.Int,4, port.Fbiller),
db.MakeInParam("@FQty", SqlDbType.Decimal,50, port.FQty),
db.MakeInParam("@FPrice", SqlDbType.Decimal,50, port.FPrice),
db.MakeInParam("@FAmount", SqlDbType.Decimal,50, port.FAmount),
db.MakeInParam("@FDate", SqlDbType.DateTime,50, port.FDate),
};
try
{
if (Iport == 0)
bSuc = db.PortTransactSql1(visitor, "Insert", prams, out nEffectRows);
if (Iport == 1)
bSuc = db.PortTransactSql2(visitor, "Insert", prams, out nEffectRows);
}
catch (Exception ex) { throw new Exception(ex.Message); }
finally
{
db.Dispose();
}
if (bSuc && nEffectRows > 0)
return "0101";
else
return "0";
}