public void IncRepoDownloadCount(string platform, string version) { try { RepositoryDownload rp = null; do { rp = db.SelectObjectWhere <RepositoryDownload> ("Platform={0} AND TargetAppVersion={1} AND Date={2} AND ApplicationId={3}", platform, version, DateTime.Now.Date, userModel.CurrentApplication.Id); if (rp == null) { rp = new RepositoryDownload(); rp.Platform = platform; rp.TargetAppVersion = version; rp.Date = DateTime.Now.Date; rp.ApplicationId = userModel.CurrentApplication.Id; rp.Downloads = 1; db.InsertObject(rp); return; } rp.Downloads++; } while (!db.UpdateObject(rp)); } catch (Exception ex) { Console.WriteLine(ex); } }
public void IncRepoDownloadCount(string platform, string version) { try { RepositoryDownload rp = null; do { rp = db.SelectObjectWhere<RepositoryDownload> ("Platform={0} AND TargetAppVersion={1} AND Date={2} AND ApplicationId={3}", platform, version, DateTime.Now.Date, userModel.CurrentApplication.Id); if (rp == null) { rp = new RepositoryDownload (); rp.Platform = platform; rp.TargetAppVersion = version; rp.Date = DateTime.Now.Date; rp.ApplicationId = userModel.CurrentApplication.Id; rp.Downloads = 1; db.InsertObject (rp); return; } rp.Downloads++; } while (!db.UpdateObject (rp)); } catch (Exception ex) { Console.WriteLine (ex); } }