public int Update(SiteMenuInfo model) { string strSql = SQL_UPDATE + PK_PARA_SET; DbParameter[] paras = makeParameterForUpdate(model); return(Db.Helper.ExecuteNonQuery(strSql, paras)); }
public int Update(SiteMenuInfo model, DbTransaction tran) { string strSql = SQL_UPDATE + PK_PARA_SET; DbParameter[] para = makeParameterForUpdate(model); return(Db.Helper.ExecuteNonQuery(tran, strSql, para)); }
private void fillModel(DbDataReader dr, SiteMenuInfo model) { model.ID = dr.GetInt32(0); model.Name = dr.GetString(1); model.StartTag = dr.GetString(2); model.Url = dr.GetString(3); model.ParentID = dr.GetInt32(4); model.Remarks = dr.GetString(5); model.ExtraFields = FieldsHelper.XmlDeserialize(dr.GetString(6)); }
private DbParameter[] makeParameterForAdd(SiteMenuInfo model) { DbParameter[] paras = { Db.Helper.MakeInParameter("@Name", model.Name), Db.Helper.MakeInParameter("@StartTag", model.StartTag), Db.Helper.MakeInParameter("@Url", model.Url), Db.Helper.MakeInParameter("@ParentID", model.ParentID), Db.Helper.MakeInParameter("@Remarks", model.Remarks), Db.Helper.MakeInParameter("@ExtraFields", FieldsHelper.XmlSerialize(model.ExtraFields)) }; return(paras); }
public int Add(SiteMenuInfo model) { DbParameter[] paras = makeParameterForAdd(model); return(Db.Helper.ExecuteNonQuery(SQL_ADD, paras)); }
public int Add(SiteMenuInfo model, DbTransaction tran) { DbParameter[] para = makeParameterForAdd(model); return(Db.Helper.ExecuteNonQuery(tran, SQL_ADD, para)); }