Exemple #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.BST.staff_log GetModel(string id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select id,name,imagevideo,imagesql,info,authority,data_keepon1,data_keepon2,data_keepon3,data_keepon4,data_keepon5 from staff_log ");
            strSql.Append(" where id=@id ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@id", MySqlDbType.VarChar, 100)
            };
            parameters[0].Value = id;

            Maticsoft.Model.BST.staff_log model = new Maticsoft.Model.BST.staff_log();
            DataSet ds = DbHelperMySQLP.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.BST.staff_card GetModel(string id_card)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select id_card,name,auth_type,is_register,date_begin,date_end from staff_card ");
            strSql.Append(" where id_card=@id_card ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@id_card", MySqlDbType.VarChar, 60)
            };
            parameters[0].Value = id_card;

            Maticsoft.Model.BST.staff_card model = new Maticsoft.Model.BST.staff_card();
            DataSet ds = DbHelperMySQLP.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }