/// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(XHD.Model.scm_authority_supply model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update scm_authority_supply set ");
            strSql.Append("Suppliers_Id=@Suppliers_Id,");
            strSql.Append("App_ids=@App_ids,");
            strSql.Append("Menu_ids=@Menu_ids,");
            strSql.Append("Button_ids=@Button_ids,");
            strSql.Append("Create_id=@Create_id,");
            strSql.Append("Create_date=@Create_date");
            strSql.Append(" where Factory_Id=@Factory_Id ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Suppliers_Id", MySqlDbType.Int32,       11),
                new MySqlParameter("@App_ids",      MySqlDbType.VarChar,    250),
                new MySqlParameter("@Menu_ids",     MySqlDbType.VarChar,   1000),
                new MySqlParameter("@Button_ids",   MySqlDbType.VarChar,   3000),
                new MySqlParameter("@Create_id",    MySqlDbType.Int32,       11),
                new MySqlParameter("@Create_date",  MySqlDbType.DateTime),
                new MySqlParameter("@Factory_Id",   MySqlDbType.VarChar, 60)
            };
            parameters[0].Value = model.Suppliers_Id;
            parameters[1].Value = model.App_ids;
            parameters[2].Value = model.Menu_ids;
            parameters[3].Value = model.Button_ids;
            parameters[4].Value = model.Create_id;
            parameters[5].Value = model.Create_date;
            parameters[6].Value = model.Factory_Id;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(XHD.Model.scm_authority_supply model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into scm_authority_supply(");
            strSql.Append("Factory_Id,Suppliers_Id,App_ids,Menu_ids,Button_ids,Create_id,Create_date)");
            strSql.Append(" values (");
            strSql.Append("@Factory_Id,@Suppliers_Id,@App_ids,@Menu_ids,@Button_ids,@Create_id,@Create_date)");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Factory_Id",   MySqlDbType.VarChar,   60),
                new MySqlParameter("@Suppliers_Id", MySqlDbType.Int32,     11),
                new MySqlParameter("@App_ids",      MySqlDbType.VarChar,  250),
                new MySqlParameter("@Menu_ids",     MySqlDbType.VarChar, 1000),
                new MySqlParameter("@Button_ids",   MySqlDbType.VarChar, 3000),
                new MySqlParameter("@Create_id",    MySqlDbType.Int32,     11),
                new MySqlParameter("@Create_date",  MySqlDbType.DateTime)
            };
            parameters[0].Value = model.Factory_Id;
            parameters[1].Value = model.Suppliers_Id;
            parameters[2].Value = model.App_ids;
            parameters[3].Value = model.Menu_ids;
            parameters[4].Value = model.Button_ids;
            parameters[5].Value = model.Create_id;
            parameters[6].Value = model.Create_date;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public XHD.Model.scm_authority_supply DataRowToModel(DataRow row)
 {
     XHD.Model.scm_authority_supply model = new XHD.Model.scm_authority_supply();
     if (row != null)
     {
         if (row["Factory_Id"] != null)
         {
             model.Factory_Id = row["Factory_Id"].ToString();
         }
         if (row["Suppliers_Id"] != null && row["Suppliers_Id"].ToString() != "")
         {
             model.Suppliers_Id = int.Parse(row["Suppliers_Id"].ToString());
         }
         if (row["App_ids"] != null)
         {
             model.App_ids = row["App_ids"].ToString();
         }
         if (row["Menu_ids"] != null)
         {
             model.Menu_ids = row["Menu_ids"].ToString();
         }
         if (row["Button_ids"] != null)
         {
             model.Button_ids = row["Button_ids"].ToString();
         }
         if (row["Create_id"] != null && row["Create_id"].ToString() != "")
         {
             model.Create_id = int.Parse(row["Create_id"].ToString());
         }
         if (row["Create_date"] != null && row["Create_date"].ToString() != "")
         {
             model.Create_date = DateTime.Parse(row["Create_date"].ToString());
         }
     }
     return(model);
 }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public XHD.Model.scm_authority_supply GetModel(string Factory_Id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select Factory_Id,Suppliers_Id,App_ids,Menu_ids,Button_ids,Create_id,Create_date from scm_authority_supply ");
            strSql.Append(" where Factory_Id=@Factory_Id ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@Factory_Id", MySqlDbType.VarChar, 60)
            };
            parameters[0].Value = Factory_Id;

            XHD.Model.scm_authority_supply model = new XHD.Model.scm_authority_supply();
            DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters);

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