本文整理汇总了C#中DTcms类的典型用法代码示例。如果您正苦于以下问题:C# DTcms类的具体用法?C# DTcms怎么用?C# DTcms使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DTcms类属于命名空间,在下文中一共展示了DTcms类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Add
/// <summary>
/// ����һ������
/// </summary>
public int Add(DTcms.Model.sys_channel model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into dt_sys_channel(");
strSql.Append("model_id,name,title,sort_id)");
strSql.Append(" values (");
strSql.Append("@model_id,@name,@title,@sort_id)");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@model_id", SqlDbType.Int,4),
new SqlParameter("@name", SqlDbType.NVarChar,100),
new SqlParameter("@title", SqlDbType.NVarChar,100),
new SqlParameter("@sort_id", SqlDbType.Int,4)};
parameters[0].Value = model.model_id;
parameters[1].Value = model.name;
parameters[2].Value = model.title;
parameters[3].Value = model.sort_id;
object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
if (obj == null)
{
return 0;
}
else
{
return Convert.ToInt32(obj);
}
}
开发者ID:sichina,项目名称:DTcms_103_sql_src,代码行数:31,代码来源:sys_channel.cs
示例2: Add
/// <summary>
/// 增加一条数据
/// </summary>
public bool Add(DTcms.Model.Customer model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into Customer(");
strSql.Append("Code,Name,LinkMan,LinkTel,LinkAddress,Email,Fax,Status,Remark");
strSql.Append(") values (");
strSql.Append("@Code,@Name,@LinkMan,@LinkTel,@LinkAddress,@Email,@Fax,@Status,@Remark");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@Code", SqlDbType.VarChar,254) ,
new SqlParameter("@Name", SqlDbType.VarChar,254) ,
new SqlParameter("@LinkMan", SqlDbType.VarChar,254) ,
new SqlParameter("@LinkTel", SqlDbType.VarChar,254) ,
new SqlParameter("@LinkAddress", SqlDbType.VarChar,254) ,
new SqlParameter("@Email", SqlDbType.VarChar,254) ,
new SqlParameter("@Fax", SqlDbType.VarChar,254) ,
new SqlParameter("@Status", SqlDbType.Int,4) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254)
};
parameters[0].Value = model.Code;
parameters[1].Value = model.Name;
parameters[2].Value = model.LinkMan;
parameters[3].Value = model.LinkTel;
parameters[4].Value = model.LinkAddress;
parameters[5].Value = model.Email;
parameters[6].Value = model.Fax;
parameters[7].Value = model.Status;
parameters[8].Value = model.Remark;
return DbHelperSQL.ExecuteSql(strSql.ToString(), parameters) > 0;
}
开发者ID:uwitec,项目名称:MWMS,代码行数:37,代码来源:Customer.cs
示例3: Add
/// <summary>
/// ����һ������
/// </summary>
public int Add(DTcms.Model.photo_attribute model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into dt_photo_attribute(");
strSql.Append("channel_id,title,remark,type,default_value,sort_id,add_time)");
strSql.Append(" values (");
strSql.Append("@channel_id,@title,@remark,@type,@default_value,@sort_id,@add_time)");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@channel_id", SqlDbType.Int,4),
new SqlParameter("@title", SqlDbType.NVarChar,100),
new SqlParameter("@remark", SqlDbType.NVarChar,500),
new SqlParameter("@type", SqlDbType.Int,4),
new SqlParameter("@default_value", SqlDbType.NVarChar,500),
new SqlParameter("@sort_id", SqlDbType.Int,4),
new SqlParameter("@add_time", SqlDbType.DateTime)};
parameters[0].Value = model.channel_id;
parameters[1].Value = model.title;
parameters[2].Value = model.remark;
parameters[3].Value = model.type;
parameters[4].Value = model.default_value;
parameters[5].Value = model.sort_id;
parameters[6].Value = model.add_time;
object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
if (obj == null)
{
return 0;
}
else
{
return Convert.ToInt32(obj);
}
}
开发者ID:sichina,项目名称:DTcms_103_sql_src,代码行数:37,代码来源:photo_attribute.cs
示例4: Add
/// <summary>
/// 增加一条数据
/// </summary>
public void Add(DTcms.Model.Attach model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into Attach(");
strSql.Append("StoreWaitingGoodsId,FilePath,CreateTime,Admin,Remark");
strSql.Append(") values (");
strSql.Append("@StoreWaitingGoodsId,@FilePath,@CreateTime,@Admin,@Remark");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@StoreWaitingGoodsId", SqlDbType.Int,4) ,
new SqlParameter("@FilePath", SqlDbType.VarChar,254) ,
new SqlParameter("@CreateTime", SqlDbType.DateTime) ,
new SqlParameter("@Admin", SqlDbType.VarChar,254) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254)
};
parameters[0].Value = model.StoreWaitingGoodsId;
parameters[1].Value = model.FilePath;
parameters[2].Value = model.CreateTime;
parameters[3].Value = model.Admin;
parameters[4].Value = model.Remark;
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
开发者ID:uwitec,项目名称:MWMS,代码行数:28,代码来源:Attach.cs
示例5: Add
/// <summary>
/// 增加一条数据
/// </summary>
public bool Add(DTcms.Model.Vehicle model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into Vehicle(");
strSql.Append("PlateNumber,Driver,LinkTel,LinkAddress,Remark");
strSql.Append(") values (");
strSql.Append("@PlateNumber,@Driver,@LinkTel,@LinkAddress,@Remark");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@PlateNumber", SqlDbType.VarChar,254) ,
new SqlParameter("@Driver", SqlDbType.VarChar,254) ,
new SqlParameter("@LinkTel", SqlDbType.VarChar,254) ,
new SqlParameter("@LinkAddress", SqlDbType.VarChar,254) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254)
};
parameters[0].Value = model.PlateNumber;
parameters[1].Value = model.Driver;
parameters[2].Value = model.LinkTel;
parameters[3].Value = model.LinkAddress;
parameters[4].Value = model.Remark;
return DbHelperSQL.ExecuteSql(strSql.ToString(), parameters) > 0;
}
开发者ID:uwitec,项目名称:MWMS,代码行数:29,代码来源:Vehicle.cs
示例6: Add
/// <summary>
/// 增加一条数据
/// </summary>
public void Add(DTcms.Model.ReceivedUnitPrice model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into ReceivedUnitPrice(");
strSql.Append("ReceivedMoneyId,BeginTime,Price,EndTime,Remark");
strSql.Append(") values (");
strSql.Append("@ReceivedMoneyId,@BeginTime,@Price,@EndTime,@Remark");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@ReceivedMoneyId", SqlDbType.Int,4) ,
new SqlParameter("@BeginTime", SqlDbType.DateTime) ,
new SqlParameter("@Price", SqlDbType.Decimal,9) ,
new SqlParameter("@EndTime", SqlDbType.DateTime) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254)
};
parameters[0].Value = model.ReceivedMoneyId;
parameters[1].Value = model.BeginTime;
parameters[2].Value = model.Price;
parameters[3].Value = model.EndTime;
parameters[4].Value = model.Remark;
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
开发者ID:uwitec,项目名称:MWMS,代码行数:28,代码来源:ReceivedUnitPrice.cs
示例7: Add
public void Add(SqlConnection conn, SqlTransaction trans, DTcms.Model.StoreOutUnitPrice model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into StoreOutUnitPrice(");
strSql.Append("StoreOutOrderId,BeginTime,Price,EndTime,Remark");
strSql.Append(") values (");
strSql.Append("@StoreOutOrderId,@BeginTime,@Price,@EndTime,@Remark");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@StoreOutOrderId", SqlDbType.Int,4) ,
new SqlParameter("@BeginTime", SqlDbType.DateTime) ,
new SqlParameter("@Price", SqlDbType.Decimal,9) ,
new SqlParameter("@EndTime", SqlDbType.DateTime) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254)
};
parameters[0].Value = model.StoreOutOrderId;
parameters[1].Value = model.BeginTime;
parameters[2].Value = model.Price;
parameters[3].Value = model.EndTime;
parameters[4].Value = model.Remark;
DbHelperSQL.ExecuteSql(conn, trans, strSql.ToString(), parameters);
}
开发者ID:uwitec,项目名称:MWMS,代码行数:25,代码来源:StoreOutUnitPrice.cs
示例8: Add
public void Add(SqlConnection conn, SqlTransaction trans, DTcms.Model.StoreOutGoods model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into StoreOutGoods(");
strSql.Append("StoreOutOrderId,StoreInOrderId,StoreInGoodsId,StoreOutWaitingGoodsId,Remark,Status,Count");
strSql.Append(") values (");
strSql.Append("@StoreOutOrderId,@StoreInOrderId,@StoreInGoodsId,@StoreOutWaitingGoodsId,@Remark,@Status,@Count");
strSql.Append(") ");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@StoreOutOrderId", SqlDbType.Int,4) ,
new SqlParameter("@StoreInOrderId", SqlDbType.Int,4) ,
new SqlParameter("@StoreInGoodsId", SqlDbType.Int,4) ,
new SqlParameter("@StoreOutWaitingGoodsId", SqlDbType.Int,4) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254) ,
new SqlParameter("@Status", SqlDbType.Int,4) ,
new SqlParameter("@Count", SqlDbType.Decimal,9)
};
parameters[0].Value = model.StoreOutOrderId;
parameters[1].Value = model.StoreInOrderId;
parameters[2].Value = model.StoreInGoodsId;
parameters[3].Value = model.StoreOutWaitingGoodsId;
parameters[4].Value = model.Remark;
parameters[5].Value = model.Status;
parameters[6].Value = model.Count;
new StoreInGoods().UpdateField(conn, trans, model.StoreInGoodsId, " Count = Count - " + model.Count + " ");
new StoreOutWaitingGoods().UpdateField(conn, trans, model.StoreOutWaitingGoodsId, " Status = 1 ");
DbHelperSQL.ExecuteSql(conn, trans, strSql.ToString(), parameters);
}
开发者ID:uwitec,项目名称:MWMS,代码行数:34,代码来源:StoreOutGoods.cs
示例9: Add
/// <summary>
/// 增加一条数据
/// </summary>
public bool Add(DTcms.Model.Store model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into Store(");
strSql.Append("StoreDomainId,Name,Manager,Address,Remark");
strSql.Append(") values (");
strSql.Append("@StoreDomainId,@Name,@Manager,@Address,@Remark");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@StoreDomainId", SqlDbType.Int,4) ,
new SqlParameter("@Name", SqlDbType.VarChar,254) ,
new SqlParameter("@Manager", SqlDbType.VarChar,254) ,
new SqlParameter("@Address", SqlDbType.VarChar,254) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254)
};
parameters[0].Value = model.StoreDomainId;
parameters[1].Value = model.Name;
parameters[2].Value = model.Manager;
parameters[3].Value = model.Address;
parameters[4].Value = model.Remark;
return DbHelperSQL.ExecuteSql(strSql.ToString(), parameters) > 0;
}
开发者ID:uwitec,项目名称:MWMS,代码行数:28,代码来源:Store.cs
示例10: Add
public void Add(SqlConnection conn, SqlTransaction trans, DTcms.Model.StoreInGoods model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into StoreInGoods(");
strSql.Append("StoreInOrderId,StoreId,StoreWaitingGoodsId,CustomerId,Status,Count,StoredInTime,Remark,GoodsId");
strSql.Append(") values (");
strSql.Append("@StoreInOrderId,@StoreId,@StoreWaitingGoodsId,@CustomerId,@Status,@Count,@StoredInTime,@Remark,@GoodsId");
strSql.Append(") ");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@StoreInOrderId", SqlDbType.Int,4) ,
new SqlParameter("@StoreId", SqlDbType.Int,4) ,
new SqlParameter("@StoreWaitingGoodsId", SqlDbType.Int,4) ,
new SqlParameter("@CustomerId", SqlDbType.Int,4) ,
new SqlParameter("@Status", SqlDbType.Int,4) ,
new SqlParameter("@Count", SqlDbType.Decimal,9) ,
new SqlParameter("@StoredInTime", SqlDbType.DateTime) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254) ,
new SqlParameter("@GoodsId", SqlDbType.Int,4) ,
};
parameters[0].Value = model.StoreInOrderId;
parameters[1].Value = model.StoreId;
parameters[2].Value = model.StoreWaitingGoodsId;
parameters[3].Value = model.CustomerId;
parameters[4].Value = model.Status;
parameters[5].Value = model.Count;
parameters[6].Value = model.StoredInTime;
parameters[7].Value = model.Remark;
parameters[8].Value = model.GoodsId;
DbHelperSQL.ExecuteSql(conn, trans, strSql.ToString(), parameters);
}
开发者ID:uwitec,项目名称:MWMS,代码行数:33,代码来源:StoreInGoods.cs
示例11: Add
/// <summary>
/// 增加一条数据
/// </summary>
public bool Add(DTcms.Model.AllotOrder model)
{
using (SqlConnection conn = new SqlConnection(DbHelperSQL.connectionString))
{
conn.Open();
using (SqlTransaction trans = conn.BeginTransaction())
{
try
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into AllotOrder(");
strSql.Append("AllotTime,Status,Remark,CreateTime,Admin");
strSql.Append(") values (");
strSql.Append("@AllotTime,@Status,@Remark,@CreateTime,@Admin");
strSql.Append(") ");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@AllotTime", SqlDbType.DateTime) ,
new SqlParameter("@Status", SqlDbType.Int,4) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254) ,
new SqlParameter("@CreateTime", SqlDbType.DateTime) ,
new SqlParameter("@Admin", SqlDbType.VarChar,254)
};
parameters[0].Value = model.AllotTime;
parameters[1].Value = model.Status;
parameters[2].Value = model.Remark;
parameters[3].Value = model.CreateTime;
parameters[4].Value = model.Admin;
object obj = DbHelperSQL.GetSingle(conn, trans, strSql.ToString(), parameters); //带事务
model.Id = Convert.ToInt32(obj);
#region 调拨货物====================
if (model.AllotGoods.Count > 0)
{
AllotGoods allotGoodsDAL = new AllotGoods();
foreach (Model.AllotGoods allotGoods in model.AllotGoods)
{
allotGoods.AllotOrderId = model.Id;
allotGoodsDAL.Add(conn, trans, allotGoods);
}
}
#endregion
trans.Commit();
}
catch
{
trans.Rollback();
return false;
}
}
}
return model.Id > 0;
}
开发者ID:uwitec,项目名称:MWMS,代码行数:60,代码来源:AllotOrder.cs
示例12: Add
public int Add(SqlConnection conn, SqlTransaction trans, DTcms.Model.AllotGoods model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into AllotGoods(");
strSql.Append("AllotOrderId,StoreInOrderId,StoreInGoodsId,Remark,Count,Status,SourceStoreId,PurposeStoreId ");
strSql.Append(") values (");
strSql.Append("@AllotOrderId,@StoreInOrderId,@StoreInGoodsId,@Remark,@Count,@Status,@SourceStoreId,@PurposeStoreId");
strSql.Append(") ");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@AllotOrderId", SqlDbType.Int,4) ,
new SqlParameter("@StoreInOrderId", SqlDbType.Int,4) ,
new SqlParameter("@StoreInGoodsId", SqlDbType.Int,4) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254) ,
new SqlParameter("@Count", SqlDbType.Decimal,9) ,
new SqlParameter("@Status", SqlDbType.Int,4),
new SqlParameter("@SourceStoreId", SqlDbType.Int,4) ,
new SqlParameter("@PurposeStoreId", SqlDbType.Int,4)
};
parameters[0].Value = model.AllotOrderId;
parameters[1].Value = model.StoreInOrderId;
parameters[2].Value = model.StoreInGoodsId;
parameters[3].Value = model.Remark;
parameters[4].Value = model.Count;
parameters[5].Value = model.Status;
parameters[6].Value = model.SourceStoreId;
parameters[7].Value = model.PurposeStoreId;
object obj = DbHelperSQL.GetSingle(conn, trans, strSql.ToString(), parameters);
StoreInGoods storeInGoodsDAL = new StoreInGoods();
Model.StoreInGoods storeInGoods = storeInGoodsDAL.GetModel(model.StoreInGoodsId);
if (storeInGoods != null)
{
storeInGoodsDAL.UpdateField(conn, trans, model.StoreInGoodsId, " Count = Count - " + model.Count + "");
Model.StoreInGoods newStoreInGoods = new Model.StoreInGoods(model.PurposeStoreId, storeInGoods.StoreWaitingGoodsId, storeInGoods.CustomerId, storeInGoods.GoodsId, model.Count, "调拨货物");
newStoreInGoods.StoreInOrderId = model.StoreInOrderId;
newStoreInGoods.Status = 1;
storeInGoodsDAL.Add(conn, trans, newStoreInGoods);
}
if (obj == null)
{
return 0;
}
else
{
return Convert.ToInt32(obj);
}
}
开发者ID:uwitec,项目名称:MWMS,代码行数:55,代码来源:AllotGoods.cs
示例13: Add
/// <summary>
/// ����һ������,�����ӱ�����
/// </summary>
public int Add(DTcms.Model.sys_model model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into dt_sys_model(");
strSql.Append("title,sort_id,inherit_index,inherit_list,inherit_detail,is_sys)");
strSql.Append(" values (");
strSql.Append("@title,@sort_id,@inherit_index,@inherit_list,@inherit_detail,@is_sys)");
strSql.Append(";set @ReturnValue= @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@title", SqlDbType.NVarChar,100),
new SqlParameter("@sort_id", SqlDbType.Int,4),
new SqlParameter("@inherit_index", SqlDbType.NVarChar,255),
new SqlParameter("@inherit_list", SqlDbType.NVarChar,255),
new SqlParameter("@inherit_detail", SqlDbType.NVarChar,255),
new SqlParameter("@is_sys", SqlDbType.TinyInt,1),
new SqlParameter("@ReturnValue",SqlDbType.Int)};
parameters[0].Value = model.title;
parameters[1].Value = model.sort_id;
parameters[2].Value = model.inherit_index;
parameters[3].Value = model.inherit_list;
parameters[4].Value = model.inherit_detail;
parameters[5].Value = model.is_sys;
parameters[6].Direction = ParameterDirection.Output;
List<CommandInfo> sqllist = new List<CommandInfo>();
CommandInfo cmd = new CommandInfo(strSql.ToString(), parameters);
sqllist.Add(cmd);
StringBuilder strSql2;
foreach (DTcms.Model.sys_model_nav models in model.sys_model_navs)
{
strSql2 = new StringBuilder();
strSql2.Append("insert into dt_sys_model_nav(");
strSql2.Append("model_id,title,nav_url,sort_id)");
strSql2.Append(" values (");
strSql2.Append("@model_id,@title,@nav_url,@sort_id)");
SqlParameter[] parameters2 = {
new SqlParameter("@model_id", SqlDbType.Int,4),
new SqlParameter("@title", SqlDbType.NVarChar,100),
new SqlParameter("@nav_url", SqlDbType.NVarChar,255),
new SqlParameter("@sort_id", SqlDbType.Int,4)};
parameters2[0].Direction = ParameterDirection.InputOutput;
parameters2[1].Value = models.title;
parameters2[2].Value = models.nav_url;
parameters2[3].Value = models.sort_id;
cmd = new CommandInfo(strSql2.ToString(), parameters2);
sqllist.Add(cmd);
}
DbHelperSQL.ExecuteSqlTranWithIndentity(sqllist);
return (int)parameters[6].Value;
}
开发者ID:sichina,项目名称:DTcms_103_sql_src,代码行数:54,代码来源:sys_model.cs
示例14: Add
/// <summary>
/// 增加一条数据
/// </summary>
public int Add(DTcms.Model.attributes model)
{
int newId;
using (OleDbConnection conn = new OleDbConnection(DbHelperOleDb.connectionString))
{
conn.Open();
using (OleDbTransaction trans = conn.BeginTransaction())
{
try
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into dt_attributes(");
strSql.Append("channel_id,title,remark,type,default_value,sort_id,add_time)");
strSql.Append(" values (");
strSql.Append("@channel_id,@title,@remark,@type,@default_value,@sort_id,@add_time)");
OleDbParameter[] parameters = {
new OleDbParameter("@channel_id", OleDbType.Integer,4),
new OleDbParameter("@title", OleDbType.VarChar,100),
new OleDbParameter("@remark", OleDbType.VarChar,500),
new OleDbParameter("@type", OleDbType.Integer,4),
new OleDbParameter("@default_value", OleDbType.VarChar,500),
new OleDbParameter("@sort_id", OleDbType.Integer,4),
new OleDbParameter("@add_time", OleDbType.Date)};
parameters[0].Value = model.channel_id;
parameters[1].Value = model.title;
parameters[2].Value = model.remark;
parameters[3].Value = model.type;
parameters[4].Value = model.default_value;
parameters[5].Value = model.sort_id;
parameters[6].Value = model.add_time;
DbHelperOleDb.ExecuteSql(conn, trans, strSql.ToString(), parameters);
//取得新插入的ID
newId = GetMaxId(conn, trans);
trans.Commit();
}
catch
{
trans.Rollback();
return -1;
}
}
}
return newId;
}
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:47,代码来源:attributes.cs
示例15: Add
public void Add(SqlConnection conn, SqlTransaction trans, DTcms.Model.CheckCost model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into CheckCost(");
strSql.Append("CheckRecordId,Name,Count,UnitPrice,TotalPrice,Status,PaidTime,Admin,Customer,HasBeenInvoiced,InvoicedTime,InvoicedOperator,Remark");
strSql.Append(") values (");
strSql.Append("@CheckRecordId,@Name,@Count,@UnitPrice,@TotalPrice,@Status,@PaidTime,@Admin,@Customer,@HasBeenInvoiced,@InvoicedTime,@InvoicedOperator,@Remark");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@CheckRecordId", SqlDbType.Int,4) ,
new SqlParameter("@Name", SqlDbType.VarChar,254) ,
new SqlParameter("@Count", SqlDbType.Decimal,9) ,
new SqlParameter("@UnitPrice", SqlDbType.Decimal,9) ,
new SqlParameter("@TotalPrice", SqlDbType.Decimal,9) ,
new SqlParameter("@Status", SqlDbType.Int,4) ,
new SqlParameter("@PaidTime", SqlDbType.DateTime) ,
new SqlParameter("@Admin", SqlDbType.VarChar,254) ,
new SqlParameter("@Customer", SqlDbType.VarChar,254) ,
new SqlParameter("@HasBeenInvoiced", SqlDbType.Bit,1) ,
new SqlParameter("@InvoicedTime", SqlDbType.DateTime) ,
new SqlParameter("@InvoicedOperator", SqlDbType.VarChar,254) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254)
};
parameters[0].Value = model.CheckRecordId;
parameters[1].Value = model.Name;
parameters[2].Value = model.Count;
parameters[3].Value = model.UnitPrice;
parameters[4].Value = model.TotalPrice;
parameters[5].Value = model.Status;
parameters[6].Value = model.PaidTime;
parameters[7].Value = model.Admin;
parameters[8].Value = model.Customer;
parameters[9].Value = model.HasBeenInvoiced;
parameters[10].Value = model.InvoicedTime;
parameters[11].Value = model.InvoicedOperator;
parameters[12].Value = model.Remark;
DbHelperSQL.ExecuteSql(conn, trans, strSql.ToString(), parameters);
}
开发者ID:uwitec,项目名称:MWMS,代码行数:42,代码来源:CheckCost.cs
示例16: Add
/// <summary>
/// 增加一条数据
/// </summary>
public bool Add(DTcms.Model.StoreMode model)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into StoreMode(");
strSql.Append("Name,Remark");
strSql.Append(") values (");
strSql.Append("@Name,@Remark");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@Name", SqlDbType.VarChar,254) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254)
};
parameters[0].Value = model.Name;
parameters[1].Value = model.Remark;
return DbHelperSQL.ExecuteSql(strSql.ToString(), parameters) > 0;
}
开发者ID:uwitec,项目名称:MWMS,代码行数:23,代码来源:StoreMode.cs
示例17: Add
/// <summary>
/// 增加一条数据
/// </summary>
public void Add(DTcms.Model.ReceivedOfStoreInGoods model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into ReceivedOfStoreInGoods(");
strSql.Append("ReceivedMoneyId,StoreInGoodsStoreInOrderId,StoreInGoodsId");
strSql.Append(") values (");
strSql.Append("@ReceivedMoneyId,@StoreInGoodsStoreInOrderId,@StoreInGoodsId");
strSql.Append(") ");
SqlParameter[] parameters = {
new SqlParameter("@ReceivedMoneyId", SqlDbType.Int,4) ,
new SqlParameter("@StoreInGoodsStoreInOrderId", SqlDbType.Int,4) ,
new SqlParameter("@StoreInGoodsId", SqlDbType.Int,4)
};
parameters[0].Value = model.ReceivedMoneyId;
parameters[1].Value = model.StoreInGoodsStoreInOrderId;
parameters[2].Value = model.StoreInGoodsId;
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
开发者ID:uwitec,项目名称:MWMS,代码行数:24,代码来源:ReceivedOfStoreInGoods.cs
示例18: Update
/// <summary>
/// 更新一条数据
/// </summary>
public bool Update(DTcms.Model.attributes model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("update dt_attributes set ");
strSql.Append("[email protected]_id,");
strSql.Append("[email protected],");
strSql.Append("[email protected],");
strSql.Append("[email protected],");
strSql.Append("[email protected]_value,");
strSql.Append("[email protected]_id,");
strSql.Append("[email protected]_time");
strSql.Append(" where [email protected]");
SqlParameter[] parameters = {
new SqlParameter("@channel_id", SqlDbType.Int,4),
new SqlParameter("@title", SqlDbType.NVarChar,100),
new SqlParameter("@remark", SqlDbType.NVarChar,500),
new SqlParameter("@type", SqlDbType.Int,4),
new SqlParameter("@default_value", SqlDbType.NVarChar,500),
new SqlParameter("@sort_id", SqlDbType.Int,4),
new SqlParameter("@add_time", SqlDbType.DateTime),
new SqlParameter("@id", SqlDbType.Int,4)};
parameters[0].Value = model.channel_id;
parameters[1].Value = model.title;
parameters[2].Value = model.remark;
parameters[3].Value = model.type;
parameters[4].Value = model.default_value;
parameters[5].Value = model.sort_id;
parameters[6].Value = model.add_time;
parameters[7].Value = model.id;
int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
if (rows > 0)
{
return true;
}
else
{
return false;
}
}
开发者ID:sichina,项目名称:or-dtcms2.0,代码行数:43,代码来源:attributes.cs
示例19: Add
/// <summary>
/// 增加一条数据
/// </summary>
public int Add(DTcms.Model.InvoicedRecord model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into InvoicedRecord(");
strSql.Append("ReceivedMoneyId,StoreInOrderId,CustomerId,Remark,CreateTime,Admin,Price");
strSql.Append(") values (");
strSql.Append("@ReceivedMoneyId,@StoreInOrderId,@CustomerId,@Remark,@CreateTime,@Admin,@Price");
strSql.Append(") ");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@ReceivedMoneyId", SqlDbType.Int,4) ,
new SqlParameter("@StoreInOrderId", SqlDbType.Int,4) ,
new SqlParameter("@CustomerId", SqlDbType.Int,4) ,
new SqlParameter("@Remark", SqlDbType.VarChar,254) ,
new SqlParameter("@CreateTime", SqlDbType.DateTime) ,
new SqlParameter("@Admin", SqlDbType.VarChar,254) ,
new SqlParameter("@Price", SqlDbType.Decimal,9)
};
parameters[0].Value = model.ReceivedMoneyId;
parameters[1].Value = model.StoreInOrderId;
parameters[2].Value = model.CustomerId;
parameters[3].Value = model.Remark;
parameters[4].Value = model.CreateTime;
parameters[5].Value = model.Admin;
parameters[6].Value = model.Price;
object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
if (obj == null)
{
return 0;
}
else
{
return Convert.ToInt32(obj);
}
}
开发者ID:uwitec,项目名称:MWMS,代码行数:43,代码来源:InvoicedRecord.cs
示例20: Add
/// <summary>
/// 增加一条数据
/// </summary>
public int Add(DTcms.Model.sys_channel model)
{
int newId;
using (OleDbConnection conn = new OleDbConnection(DbHelperOleDb.connectionString))
{
conn.Open();
using (OleDbTransaction trans = conn.BeginTransaction())
{
try
{
StringBuilder strSql = new StringBuilder();
strSql.Append("insert into dt_sys_channel(");
strSql.Append("model_id,[name],title,sort_id)");
strSql.Append(" values (");
strSql.Append("@model_id,@name,@title,@sort_id)");
OleDbParameter[] parameters = {
new OleDbParameter("@model_id", OleDbType.Integer,4),
new OleDbParameter("@name", OleDbType.VarChar,100),
new OleDbParameter("@title", OleDbType.VarChar,100),
new OleDbParameter("@sort_id", OleDbType.Integer,4)};
parameters[0].Value = model.model_id;
parameters[1].Value = model.name;
parameters[2].Value = model.title;
parameters[3].Value = model.sort_id;
DbHelperOleDb.ExecuteSql(conn, trans, strSql.ToString(), parameters);
//取得新插入的ID
newId =
|
请发表评论