Example #1
0
        public int Update(SiteRoleInfo model)
        {
            string strSql = SQL_UPDATE + PK_PARA_SET;

            DbParameter[] paras = makeParameterForUpdate(model);
            return(Db.Helper.ExecuteNonQuery(strSql, paras));
        }
Example #2
0
        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));
        }
Example #3
0
 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));
 }
Example #4
0
 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);
 }
Example #5
0
 public int Add(SiteRoleInfo model)
 {
     DbParameter[] paras = makeParameterForAdd(model);
     return(Db.Helper.ExecuteNonQuery(SQL_ADD, paras));
 }
Example #6
0
 public int Add(SiteRoleInfo model, DbTransaction tran)
 {
     DbParameter[] para = makeParameterForAdd(model);
     return(Db.Helper.ExecuteNonQuery(tran, SQL_ADD, para));
 }