Esempio n. 1
0
        public int Update(SiteMenuInfo model)
        {
            string strSql = SQL_UPDATE + PK_PARA_SET;

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