/// <summary>
 /// ����ʵ�������
 /// </summary>
 public ScenceModel ReaderBind(IDataReader dataReader)
 {
     ScenceModel model=new ScenceModel();
     object ojb;
     ojb = dataReader["ScenceId"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.ScenceId=Convert.ToInt32(ojb);
     }
     model.ScenceName=dataReader["ScenceName"].ToString();
     model.Remark=dataReader["Remark"].ToString();
     model.SenceImg= dataReader["SenceImg"].ToString();
     ojb = dataReader["SenceType"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.SenceType=Convert.ToInt32(ojb);
     }
     ojb = dataReader["IsActive"];
     if(ojb != null && ojb != DBNull.Value)
     {
         model.IsActive=Convert.ToBoolean(ojb);
     }
     return model;
 }
        /// <summary>
        ///  ����һ������
        /// </summary>
        public void Save(ScenceModel model)
        {
            if (model.ScenceId == 0)
                model.ScenceId = CommDataHelper.GetNewSerialNum(AppType.Solution);

            DbCommand dbCommand = dbw.GetStoredProcCommand("UP_slScence_Save");
            dbw.AddInParameter(dbCommand, "ScenceId", DbType.Int32, model.ScenceId);
            dbw.AddInParameter(dbCommand, "ScenceName", DbType.AnsiString, model.ScenceName);
            dbw.AddInParameter(dbCommand, "Remark", DbType.AnsiString, model.Remark);
            dbw.AddInParameter(dbCommand, "SenceImg", DbType.AnsiString, model.SenceImg);
            dbw.AddInParameter(dbCommand, "SenceType", DbType.Byte, model.SenceType);
            dbw.AddInParameter(dbCommand, "IsActive", DbType.Boolean, model.IsActive);
            dbw.ExecuteNonQuery(dbCommand);
        }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Save(NoName.NetShop.Solution.Model.ScenceModel model)
 {
     dal.Save(model);
 }