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

            DbParameter[] paras = makeParameterForUpdate(model);
            return(Db.Helper.ExecuteNonQuery(strSql, paras));
        }
Example #2
0
        public int Update(LineDetailInfo 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, LineDetailInfo model)
 {
     model.ID              = dr.GetInt32(0);
     model.LineID          = dr.GetInt32(1);
     model.Title           = dr.GetString(2);
     model.DayDesc         = dr.GetString(3);
     model.DayPics         = dr.GetString(4);
     model.SortOrder       = dr.GetInt32(5);
     model.WarmTips        = dr.GetString(6);
     model.Remarks         = dr.GetString(7);
     model.AddUserName     = dr.GetString(8);
     model.AddUserRealName = dr.GetString(9);
     model.AddTime         = dr.GetDateTime(10);
     model.ExtraFields     = FieldsHelper.XmlDeserialize(dr.GetString(11));
 }
Example #4
0
 private DbParameter[] makeParameterForAdd(LineDetailInfo model)
 {
     DbParameter[] paras =
     {
         Db.Helper.MakeInParameter("@LineID",          model.LineID),
         Db.Helper.MakeInParameter("@Title",           model.Title),
         Db.Helper.MakeInParameter("@DayDesc",         model.DayDesc),
         Db.Helper.MakeInParameter("@DayPics",         model.DayPics),
         Db.Helper.MakeInParameter("@SortOrder",       model.SortOrder),
         Db.Helper.MakeInParameter("@WarmTips",        model.WarmTips),
         Db.Helper.MakeInParameter("@Remarks",         model.Remarks),
         Db.Helper.MakeInParameter("@AddUserName",     model.AddUserName),
         Db.Helper.MakeInParameter("@AddUserRealName", model.AddUserRealName),
         Db.Helper.MakeInParameter("@AddTime",         model.AddTime),
         Db.Helper.MakeInParameter("@ExtraFields",     FieldsHelper.XmlSerialize(model.ExtraFields))
     };
     return(paras);
 }
Example #5
0
 public int Add(LineDetailInfo model)
 {
     DbParameter[] paras = makeParameterForAdd(model);
     return(Db.Helper.ExecuteNonQuery(SQL_ADD, paras));
 }
Example #6
0
 public int Add(LineDetailInfo model, DbTransaction tran)
 {
     DbParameter[] para = makeParameterForAdd(model);
     return(Db.Helper.ExecuteNonQuery(tran, SQL_ADD, para));
 }