Exemple #1
0
        private void btnProductIncomeCalculator_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                string             path    = "..\\..\\..\\Json-Reports\\";
                CupOfCoffeeContext context = new CupOfCoffeeContext();
                var reports = ProductsReportsLoader.GetProductsSaleInfo(context);
                ProductsReportsLoader.GenerateJsonReports(reports, path);

                MySqlModel mySqlCOntext = new MySqlModel();
                ProductsReportsLoader.AddReports(reports, mySqlCOntext);

                MessageBox.Show("The products reports were successfully generated!",
                                "Generated successfully",
                                MessageBoxButton.OK,
                                MessageBoxImage.Information);

                Process.Start(path);
            }
            catch (Exception)
            {
                MessageBox.Show("Cannot generate the products reports!",
                                "Generation failed",
                                MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }
        }
        public string cfab96c5584a38a84561c0d6ccc38ed4(FormCollection Ambi)
        {
            MySqlModel.updateAnswers(Session["personId"].ToString(), Ambi);

            // /questions/pageiv/
            return("/db9044c0d2425a2e5b9c1e48463c52b4/");
        }
Exemple #3
0
        private void btnTotalProfitCalculator_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var path         = "total-profit.xlsx";
                var mySqlCOntext = new MySqlModel();
                var products     = ProductsReportsLoader.GetReportsFromMySql(mySqlCOntext);

                // TODO: Change it with entity framework
                var vendorsProduct = SqliteParser.GetVendorsProducts();
                ExcelGenerator.Generate(products, vendorsProduct, path);

                MessageBox.Show("The total profit report was successfully generated!",
                                "Generated successfully",
                                MessageBoxButton.OK,
                                MessageBoxImage.Information);

                Process.Start(path);
            }
            catch (Exception)
            {
                MessageBox.Show("Cannot generate the total profit report!",
                                "Generation failed",
                                MessageBoxButton.OK,
                                MessageBoxImage.Error);
            }
        }
        public string fc7c91ef31aa22cc8ad4c221b12b770ed(FormCollection Emotion)
        {
            MySqlModel.updateAnswers(Session["personId"].ToString(), Emotion);

            // /questions/thanks/
            return("/g00d06796e489999226fb5bb27fe1b3b2/");
        }
        public string e528c25aaf5807c50aad6bc058c013a29(FormCollection Covid)
        {
            MySqlModel.updateAnswers(Session["personId"].ToString(), Covid);

            // /questions/pagex/
            return("/fc7c91ef31aa22cc8ad4c221b12b770ed/");
        }
        public string db9044c0d2425a2e5b9c1e48463c52b4(FormCollection Dark)
        {
            MySqlModel.updateAnswers(Session["personId"].ToString(), Dark);

            // /questions/pagevi/
            return("/e528c25aaf5807c50aad6bc058c013a29/");
        }
Exemple #7
0
 private static void UpdateDatabase()
 {
     using (var context = new MySqlModel())
     {
         var schemaHandler = context.GetSchemaHandler();
         EnsureDB(schemaHandler);
     }
 }
Exemple #8
0
 public static void AddReports(ICollection <IProductReport> reports, MySqlModel context)
 {
     using (context)
     {
         foreach (var report in reports)
         {
             context.Add(report);
         }
         context.SaveChanges();
     }
 }
        public static IList <ProductReport> GetReportsFromMySql(MySqlModel context)
        {
            var reports = new List <ProductReport>();

            using (context)
            {
                reports = context.GetAll <ProductReport>().ToList();
            }

            return(reports);
        }
        public string Index(FormCollection Identification)
        {
            if (string.IsNullOrEmpty(Session["pesronId"] as string))
            {
                int personId = MySqlModel.createPerson(Identification);
                if (personId > 0)
                {
                    Session["personId"] = personId;
                }
            }

            // /questions/pagei/
            return("/cfab96c5584a38a84561c0d6ccc38ed4/");
        }
        public ActionResult Index()
        {
            var model = new MySqlModel
            {
                CurrentDatabases   = GetUserDatabases().Count,
                MaxDatabases       = GetUserServicesCount(),
                CreationServiceIds = GetUserServices(),
                EligibleLocations  = GetLocations(),
                CreationUsername   = GetDbUsername(),
                DeletionUsernames  = GetDbDeletionUsernames(),
                ResetUsernames     = GetDbResetUsernames()
            };

            return(View(model));
        }
 // GET: Questions/PageX/
 public ActionResult fc7c91ef31aa22cc8ad4c221b12b770ed()
 {
     ViewData.Add("Questions", MySqlModel.Read(4));
     return(View());
 }
 // GET: Questions/PageVI/
 public ActionResult e528c25aaf5807c50aad6bc058c013a29()
 {
     ViewData.Add("Questions", MySqlModel.Read(3));
     return(View());
 }
 // GET: Questions/PageIV/
 public ActionResult db9044c0d2425a2e5b9c1e48463c52b4()
 {
     ViewData.Add("Questions", MySqlModel.Read(2));
     return(View());
 }
 // GET: Questions/PageI/
 public ActionResult cfab96c5584a38a84561c0d6ccc38ed4()
 {
     ViewData.Add("Questions", MySqlModel.Read(1));
     return(View());
 }
 // GET: /Results/
 public ActionResult Results()
 {
     ViewData.Add("Results", MySqlModel.Result());
     return(View());
 }