示例#1
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            service = new DocumentDBService();
            manager = new PersonManager(service);
            int a = Int16.Parse(note.Text);

            eV = new Evaluation(idEmetteur.Text, firstName.Text, lastName.Text, mirror.Text, group.Text, critere.Text, a);;
            manager.SavePersonneAsync(eV, true);
            Response.Write("<script> alert('Your evaluation has been saved');</script>");
            firstName.Text  = "";
            lastName.Text   = "";
            note.Text       = "";
            idEmetteur.Text = "";
            mirror.Text     = "";
            group.Text      = "";
            critere.Text    = "";
        }
示例#2
0
 public static void LoadTemplatesToDocumentDB()
 {
     while (!isStoped)
     {
         try
         {
             GithubService.ReadARMTemplatesAsync().Wait();
             DocumentDBService.SaveTemplatesAsync().Wait();
         }
         catch (Exception ex)
         {
             Console.ForegroundColor = ConsoleColor.Red;
             Console.WriteLine("Unexpected error: {0}", ex.Message);
         }
         finally
         {
             ////Refreash templates each hour
             Thread.Sleep(3600000);
         }
     }
 }
示例#3
0
        public ActionResult Index()
        {
            var config = DocumentDBConfiguration.RetrieveAppSettings();

            if (config.Validate())
            {
                DocumentDBService service = new DocumentDBService(config);
                return(View(new AssetViewModel
                {
                    Ready = true,
                    Assets = service.GetDocuments(),
                    Count = service.CountDocuments(),
                    AverageCost = service.AverageCost(),
                    LatestAssetName = service.GetLatestAssetName()
                }));
            }
            else
            {
                return(View(new AssetViewModel
                {
                    Ready = false
                }));
            }
        }