/// <summary> /// 得到最大ID /// </summary> public int GetMaxId() { return(DbHelperMySQL.GetMaxID("dep_id", "department")); }
/// <summary> /// 得到最大ID /// </summary> public int GetMaxId() { return(DbHelperMySQL.GetMaxID("chest_id", "chest")); }
/// <summary> /// 得到最大ID /// </summary> public int GetMaxId() { return(DbHelperMySQL.GetMaxID("staff_id", "staff")); }
public int GetSysEventLogCount(string strWhere) { string sql = "select count(1) from sys_event_log {0}"; return(Convert.ToInt32(DbHelperMySQL.GetSingle(string.Format(sql, strWhere.Length > 0 ? "where " + strWhere : "")))); }
/// <summary> /// 批量运行语句(其他库) /// </summary> /// <param name="SQLStringList"></param> /// <returns></returns> public int TranLotTo(List <string> SQLStringList) { return(DbHelperMySQL.ExecuteSqlTranTo(SQLStringList)); }
/// <summary> /// 得到最大ID /// </summary> public int GetMaxId() { return(DbHelperMySQL.GetMaxID("log_num", "log_info")); }
public int GetRecordCount(string strWhere) { string sql = "select count(1) from c_stock_code {0}"; return(Convert.ToInt32(DbHelperMySQL.GetSingle(string.Format(sql, strWhere.Length > 0 ? "where " + strWhere : "")))); }
/// <summary> /// 得到最大ID /// </summary> public int GetMaxId() { return(DbHelperMySQL.GetMaxID("mat_id", "material_info")); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Model.material_info model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update material_info set "); strSql.Append("mat_name=@mat_name,"); strSql.Append("mat_father_id=@mat_father_id,"); strSql.Append("mat_create_time=@mat_create_time,"); strSql.Append("mat_fengdu=@mat_fengdu,"); strSql.Append("mat_state=@mat_state,"); strSql.Append("mat_colour=@mat_colour,"); strSql.Append("mat_smell=@mat_smell,"); strSql.Append("mat_type=@mat_type,"); strSql.Append("mat_type_id=@mat_type_id,"); strSql.Append("mat_purpose=@mat_purpose,"); strSql.Append("mat_source=@mat_source,"); strSql.Append("mat_suanjianxing=@mat_suanjianxing,"); strSql.Append("mat_yuansuzhanbi=@mat_yuansuzhanbi,"); strSql.Append("mat_yuansuliang=@mat_yuansuliang"); strSql.Append(" where mat_id=@mat_id "); MySqlParameter[] parameters = { new MySqlParameter("@mat_name", MySqlDbType.VarChar, 32), new MySqlParameter("@mat_father_id", MySqlDbType.Int32, 11), new MySqlParameter("@mat_create_time", MySqlDbType.DateTime), new MySqlParameter("@mat_fengdu", MySqlDbType.Decimal, 16), new MySqlParameter("@mat_state", MySqlDbType.Int32, 10), new MySqlParameter("@mat_colour", MySqlDbType.Int32, 10), new MySqlParameter("@mat_smell", MySqlDbType.Int32, 10), new MySqlParameter("@mat_type", MySqlDbType.Int32, 10), new MySqlParameter("@mat_type_id", MySqlDbType.Int32, 32), new MySqlParameter("@mat_purpose", MySqlDbType.VarChar, 255), new MySqlParameter("@mat_source", MySqlDbType.VarChar, 255), new MySqlParameter("@mat_suanjianxing", MySqlDbType.VarChar, 255), new MySqlParameter("@mat_yuansuzhanbi", MySqlDbType.VarChar, 255), new MySqlParameter("@mat_yuansuliang", MySqlDbType.VarChar, 255), new MySqlParameter("@mat_id", MySqlDbType.Int32, 32) }; parameters[0].Value = model.mat_name; parameters[1].Value = model.mat_father_id; parameters[2].Value = model.mat_create_time; parameters[3].Value = model.mat_fengdu; parameters[4].Value = model.mat_state; parameters[5].Value = model.mat_colour; parameters[6].Value = model.mat_smell; parameters[7].Value = model.mat_type; parameters[8].Value = model.mat_type_id; parameters[9].Value = model.mat_purpose; parameters[10].Value = model.mat_source; parameters[11].Value = model.mat_suanjianxing; parameters[12].Value = model.mat_yuansuzhanbi; parameters[13].Value = model.mat_yuansuliang; parameters[14].Value = model.mat_id; int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 是否存在该记录 /// </summary> public bool Exists(string key) { string sSql = "SELECT COUNT(1) from UserMst WHERE Phone = '" + key + "' OR UserID='" + key + "'"; return(DbHelperMySQL.Exists(sSql)); }
/// <summary> /// 得到最大ID /// </summary> public int GetMaxId() { return(DbHelperMySQL.GetMaxID("sr_id", "sr_info")); }
/// <summary> /// 得到最大ID /// </summary> public int GetMaxId() { return(DbHelperMySQL.GetMaxID("out_id", "out_storage")); }