public int Update(SiteRoleInfo model) { string strSql = SQL_UPDATE + PK_PARA_SET; DbParameter[] paras = makeParameterForUpdate(model); return(Db.Helper.ExecuteNonQuery(strSql, paras)); }
public int Update(SiteRoleInfo 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, SiteRoleInfo model) { model.ID = dr.GetInt32(0); model.Name = dr.GetString(1); model.MenuIDList = dr.GetString(2); model.Remarks = dr.GetString(3); model.ExtraFields = FieldsHelper.XmlDeserialize(dr.GetString(4)); }
private DbParameter[] makeParameterForAdd(SiteRoleInfo model) { DbParameter[] paras = { Db.Helper.MakeInParameter("@Name", model.Name), Db.Helper.MakeInParameter("@MenuIDList", model.MenuIDList), Db.Helper.MakeInParameter("@Remarks", model.Remarks), Db.Helper.MakeInParameter("@ExtraFields", FieldsHelper.XmlSerialize(model.ExtraFields)) }; return(paras); }
public int Add(SiteRoleInfo model) { DbParameter[] paras = makeParameterForAdd(model); return(Db.Helper.ExecuteNonQuery(SQL_ADD, paras)); }
public int Add(SiteRoleInfo model, DbTransaction tran) { DbParameter[] para = makeParameterForAdd(model); return(Db.Helper.ExecuteNonQuery(tran, SQL_ADD, para)); }