/// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(LingLong.Admin.Model.t_store_business model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into t_store_business(");
            strSql.Append("StoreId,BusinessId,ParentId,RoleId,State)");
            strSql.Append(" values (");
            strSql.Append("@StoreId,@BusinessId,@ParentId,@RoleId,@State)");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@StoreId",    MySqlDbType.Int32, 11),
                new MySqlParameter("@BusinessId", MySqlDbType.Int32, 11),
                new MySqlParameter("@ParentId",   MySqlDbType.Int32, 11),
                new MySqlParameter("@RoleId",     MySqlDbType.Int16,  4),
                new MySqlParameter("@State",      MySqlDbType.Int16, 4)
            };
            parameters[0].Value = model.StoreId;
            parameters[1].Value = model.BusinessId;
            parameters[2].Value = model.ParentId;
            parameters[3].Value = model.RoleId;
            parameters[4].Value = model.State;

            int rows = DbHelperMySql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public LingLong.Admin.Model.t_store_business DataRowToModel(DataRow row)
 {
     LingLong.Admin.Model.t_store_business model = new LingLong.Admin.Model.t_store_business();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = int.Parse(row["ID"].ToString());
         }
         if (row["StoreId"] != null && row["StoreId"].ToString() != "")
         {
             model.StoreId = int.Parse(row["StoreId"].ToString());
         }
         if (row["BusinessId"] != null && row["BusinessId"].ToString() != "")
         {
             model.BusinessId = int.Parse(row["BusinessId"].ToString());
         }
         if (row["ParentId"] != null && row["ParentId"].ToString() != "")
         {
             model.ParentId = int.Parse(row["ParentId"].ToString());
         }
         if (row["RoleId"] != null && row["RoleId"].ToString() != "")
         {
             model.RoleId = int.Parse(row["RoleId"].ToString());
         }
         if (row["State"] != null && row["State"].ToString() != "")
         {
             model.State = int.Parse(row["State"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(LingLong.Admin.Model.t_store_business model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update t_store_business set ");
            strSql.Append("StoreId=@StoreId,");
            strSql.Append("BusinessId=@BusinessId,");
            strSql.Append("ParentId=@ParentId,");
            strSql.Append("RoleId=@RoleId,");
            strSql.Append("State=@State");
            strSql.Append(" where ID=@ID");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@StoreId",    MySqlDbType.Int32, 11),
                new MySqlParameter("@BusinessId", MySqlDbType.Int32, 11),
                new MySqlParameter("@ParentId",   MySqlDbType.Int32, 11),
                new MySqlParameter("@RoleId",     MySqlDbType.Int16,  4),
                new MySqlParameter("@State",      MySqlDbType.Int16,  4),
                new MySqlParameter("@ID",         MySqlDbType.Int32, 11)
            };
            parameters[0].Value = model.StoreId;
            parameters[1].Value = model.BusinessId;
            parameters[2].Value = model.ParentId;
            parameters[3].Value = model.RoleId;
            parameters[4].Value = model.State;
            parameters[5].Value = model.ID;

            int rows = DbHelperMySql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public LingLong.Admin.Model.t_store_business GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ID,StoreId,BusinessId,ParentId,RoleId,State from t_store_business ");
            strSql.Append(" where ID=@ID");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@ID", MySqlDbType.Int32)
            };
            parameters[0].Value = ID;

            LingLong.Admin.Model.t_store_business model = new LingLong.Admin.Model.t_store_business();
            DataSet ds = DbHelperMySql.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LingLong.Admin.Model.t_store_business model)
 {
     return(dal.Update(model));
 }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(LingLong.Admin.Model.t_store_business model)
 {
     return(dal.Add(model));
 }