public static void SaveDownloadedFile(string versionDesc, string newVersion, string filepath) { MySqlParameter[] param = new MySqlParameter[6]; param[0] = new MySqlParameter("_updId", Guid.NewGuid()); param[1] = new MySqlParameter("_versionDesc", versionDesc); param[2] = new MySqlParameter("_updVersion", newVersion.Replace(".", "")); param[3] = new MySqlParameter("_updContent", Lawyer.Coding.FileManager.GetFileInBinaryFormat(filepath)); param[4] = new MySqlParameter("_updVersionName", newVersion); param[5] = new MySqlParameter("_updFileName", System.IO.Path.GetFileNameWithoutExtension(filepath)); DbAccessLayer.MySqlDbAccess db = new DbAccessLayer.MySqlDbAccess(ConnectionString(), DbAccessLayer.ConnectionStringSourceType.MySetting); db.ExecuteProcedure("stpDad_updateDownloadFile", param); if (db.HasError) { throw db.ErrorException; } }
public static void ReadyUpdate(string upId) { MySqlParameter[] param = new MySqlParameter[1]; param[0] = new MySqlParameter("_updId", upId); DbAccessLayer.MySqlDbAccess db = new DbAccessLayer.MySqlDbAccess(ConnectionString(), DbAccessLayer.ConnectionStringSourceType.MySetting); db.ExecuteProcedure("stpDad_updateReady", param).ToString(); if (db.HasError) { throw db.ErrorException; } }