コード例 #1
0
ファイル: StatsModel.cs プロジェクト: jsuarezruiz/cydin
 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);
     }
 }
コード例 #2
0
ファイル: StatsModel.cs プロジェクト: kitsilanosoftware/cydin
 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);
     }
 }