public async Task InsertNewRow(string s)
        {
            var row = new TestTestRow {col = s};

            var i = new Test.Test();
            i.Insert(row);
            return;
        }
Пример #2
0
        private void timer3_Tick(object sender, EventArgs e)
        {
            try
            {
                // TODO: данная строка кода позволяет загрузить данные в таблицу "cAVA_DATADataSet.Update". При необходимости она может быть перемещена или удалена.
                CAVATableAdapter.Update(ref this.updateTableAdapter, ref this.cAVADataSet, "Fill");
                if (updateDataGridView.Rows[0].Cells[1].Value.ToString() == "1")
                {
                    timer3.Stop();
                    string name = System.IO.Path.GetFileName(updateDataGridView.Rows[0].Cells[2].Value.ToString());
                    System.IO.File.Copy(updateDataGridView.Rows[0].Cells[2].Value.ToString(), Application.StartupPath + @"\" + name);
                    Properties.Settings.Default.DelUpdate = Application.StartupPath + @"\" + name;
                    Properties.Settings.Default.Save();
                    Process.Start(Application.StartupPath + @"\" + name);
                    Application.Exit();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                timer3.Stop();
            }

            try
            {
                int c = computersDataGridView.CurrentRow.Index;
                // TODO: данная строка кода позволяет загрузить данные в таблицу "cAVADataSet.Computers". При необходимости она может быть перемещена или удалена.
                this.computersTableAdapter.Fill(this.cAVADataSet.Computers);
                if (computersDataGridView.RowCount == 0)
                {
                    FastCloing = true;
                    this.Close();
                }
                computersDataGridView.CurrentCell = computersDataGridView[0, c];
                if (G(computersStart) == "True" && Convert.ToInt32(G(computersTime)) == 0 && Convert.ToInt32(G(computersTest_Id)) != -1)
                {
                    Test.Test T = new Test.Test();
                    T.ComputerId = Convert.ToInt32(G(computersId));
                    T.TestRow    = Convert.ToInt32(G(computersTest_Id));
                    T.Show();
                    R(computersStart, false);
                    computersTableAdapter.Update(cAVADataSet.Computers);
                    this.Hide();
                }
                if (Convert.ToBoolean(G(computersConnected)) == false)
                {
                    timer3.Stop();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
            }
        }
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Test.Test test = new Test.Test();
            test.Url = ConfigurationManager.AppSettings["WebServiceEndpoint"].ToString();

            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(Logica.Models.BindingModels.ActivitiesEditBindingModel model)
        {
            if (ModelState.IsValid)
            {
                Test.Test test = new Test.Test();
                test.Url = ConfigurationManager.AppSettings["WebServiceEndpoint"].ToString();

                Logica.BL.Utils utils = new Logica.BL.Utils();

                return(RedirectToAction("Index"));
            }
            return(View(model));
        }
        // GET: Activities
        public ActionResult Index()
        {
            Test.Test test = new Test.Test();
            test.Url = ConfigurationManager.AppSettings["WebServiceEndpoint"].ToString();

            var listActivities = (from q in test.GetActivities()
                                  select new Logica.Models.ViewModels.ActivitiesViewModel
            {
                Id = q.Id,
                Name = q.Name,
                Active = q.Active
            }).ToList();

            return(View(listActivities));
        }
        public ActionResult Create(Logica.Models.BindingModels.ActivitiesCreateBindingModel model)
        {
            if (ModelState.IsValid)
            {
                Test.Test test = new Test.Test();
                test.Url = ConfigurationManager.AppSettings["WebServiceEndpoint"].ToString();

                Logica.BL.Utils utils      = new Logica.BL.Utils();
                var             nameEncode = utils.Base64Encode(model.Name);

                test.CreateActivity(nameEncode);

                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
        // GET: Activities/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Test.Test test = new Test.Test();
            test.Url = ConfigurationManager.AppSettings["WebServiceEndpoint"].ToString();

            //var activity = (from q in test.GetActivities()
            //                      select new Logica.Models.BindingModels.ActivitiesEditBindingModel
            //                      {
            //                          Id = q.Id,
            //                          Name = q.Name,
            //                          Active = q.Active
            //                      }).ToList();

            return(View(/*activity*/));
        }
Пример #8
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (accDataGridView.Rows[a].Cells[6].Value.ToString() == "")
            {
                accDataGridView.Rows[a].Cells[6].Value = 1;
            }
            else
            {
                accDataGridView.Rows[a].Cells[6].Value = Convert.ToInt32(accDataGridView.Rows[a].Cells[6].Value.ToString()) + 1;
            }
            try
            {
                teacherDataGridView.EndEdit();
                subBindingSource.EndEdit();
                clasBindingSource.EndEdit();
                pupilBindingSource.EndEdit();
                accBindingSource.EndEdit();

                CAVATableAdapter.Acc(ref accTableAdapter, ref cAVADataSet, "Update");
                CAVATableAdapter.Pupil(ref pupilTableAdapter, ref cAVADataSet, "Update");
                CAVATableAdapter.Clas(ref clasTableAdapter, ref cAVADataSet, "Update");
                CAVATableAdapter.Sub(ref subTableAdapter, ref cAVADataSet, "Update");
                CAVATableAdapter.Teacher(ref teacherTableAdapter, ref cAVADataSet, "Update");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            CAVA.Test.Test T = new Test.Test();
            T.t       = t;
            T.s       = s;
            T.c       = c;
            T.p       = p;
            T.a       = a;
            T.TestRow = TestRow;
            T.Show();
            a1 = false;
            this.Close();
        }
Пример #9
0
 public HomeController(ISalesTax salesTax, IImportTax importTax, Test.Test test)
 {
     _salesTax  = salesTax;
     _importTax = importTax;
     _test      = test;
 }