public async Task <IActionResult> PutTestRegister(int id, TestRegister testRegister)
        {
            if (id != testRegister.TestRegisterId)
            {
                return(BadRequest());
            }

            _context.Entry(testRegister).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TestRegisterExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #2
0
        public ActionResult EditApp(AppDeptViewModel vm, int id, IFormCollection collection)
        {
            var tr = new TestRegister
            {
                Id        = vm.AppointmentId,
                PatientId = vm.PatientId,
                Date      = DateTime.Now,
                TId       = vm.TestId,
                Result    = new TestResult
                {
                    IsCompleted = vm.IsCompleted
                }
            };

            try
            {
                if (id > 0)
                {
                    _testRepo.UpdateAppointment(tr);
                }
                else
                {
                    _testRepo.AddAppointment(tr);
                }
                _testRepo.SaveChangesAsync();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View(tr));
            }
        }
Example #3
0
 public void RecursiveRightMove()
 {
     Create("cat", "dog");
     _globalSettings.VirtualEdit = string.Empty; // Ensure not 've=onemore'
     TestRegister.UpdateValue("l@c");
     _vimBuffer.Process("@c");
     Assert.Equal(2, _textView.GetCaretPoint().Position);
 }
Example #4
0
 public void ReadTheRegister()
 {
     Create("");
     TestRegister.UpdateValue("iwin");
     _vimBuffer.VimData.LastMacroRun = FSharpOption.Create('c');
     _vimBuffer.Process("@@");
     Assert.Equal("win", _textView.GetLine(0).GetText());
 }
Example #5
0
 public void InsertText()
 {
     Create("world");
     TestRegister.UpdateValue("ihello ");
     _vimBuffer.Process("@c");
     Assert.Equal(ModeKind.Insert, _vimBuffer.ModeKind);
     Assert.Equal("hello world", _textView.GetLine(0).GetText());
 }
Example #6
0
 public void InsertTextWithEsacpe()
 {
     Create("world");
     TestRegister.UpdateValue("ihello ", VimKey.Escape);
     _vimBuffer.Process("@c");
     Assert.Equal(ModeKind.Normal, _vimBuffer.ModeKind);
     Assert.Equal("hello world", _textView.GetLine(0).GetText());
 }
Example #7
0
 public void RepeatLastCommand_DeleteWord()
 {
     Create("hello world again");
     TestRegister.UpdateValue(".");
     _vimBuffer.Process("dw@c");
     Assert.Equal("again", _textView.GetLine(0).GetText());
     Assert.True(_vimBuffer.VimData.LastMacroRun.IsSome('c'));
 }
Example #8
0
 public void UpMove()
 {
     Create("dog cat tree", "dog cat tree");
     TestRegister.UpdateValue("lkdw");
     _vimBuffer.Process("@c");
     Assert.Equal("dog cat tree", _textView.GetLine(0).GetText());
     Assert.Equal(1, _textView.GetCaretPoint().Position);
 }
Example #9
0
 public void WithCount()
 {
     Create("cat", "dog", "bear");
     TestRegister.UpdateValue("~", VimKey.Left, VimKey.Down);
     _vimBuffer.Process("2@c");
     Assert.Equal("Cat", _textView.GetLine(0).GetText());
     Assert.Equal("Dog", _textView.GetLine(1).GetText());
 }
Example #10
0
 public void LeftMoveBeforeLine()
 {
     Create("dog cat tree");
     _textView.MoveCaretTo(1);
     TestRegister.UpdateValue("hhhhdw");
     _vimBuffer.Process("@c");
     Assert.Equal(1, VimHost.BeepCount);
     Assert.Equal("dog cat tree", _textBuffer.GetLine(0).GetText());
     Assert.Equal(0, _textView.GetCaretPoint());
 }
Example #11
0
 public void RightMoveAfterLine()
 {
     Create("dog cat");
     _textView.MoveCaretTo(4);
     TestRegister.UpdateValue("lllllD");
     _vimBuffer.Process("@c");
     Assert.Equal(1, VimHost.BeepCount);
     Assert.Equal("dog cat", _textBuffer.GetLine(0).GetText());
     Assert.Equal(6, _textView.GetCaretPoint());
 }
Example #12
0
 public void UndoMacroWithCount()
 {
     Create("cat", "dog", "bear");
     TestRegister.UpdateValue("~", VimKey.Left, VimKey.Down);
     _vimBuffer.Process("2@c");
     _vimBuffer.Process("u");
     Assert.Equal(0, _textView.GetCaretPoint().Position);
     Assert.Equal("cat", _textView.GetLine(0).GetText());
     Assert.Equal("dog", _textView.GetLine(1).GetText());
 }
Example #13
0
 public void StartOfLineAndChange()
 {
     Create("  cat dog");
     _textView.MoveCaretTo(2);
     TestRegister.UpdateValue("^cwfish");
     _vimBuffer.Process("@c");
     Assert.Equal(0, VimHost.BeepCount);
     Assert.Equal("  fish dog", _textBuffer.GetLine(0).GetText());
     Assert.Equal(6, _textView.GetCaretPoint());
 }
Example #14
0
 public void RepeatCommandAfterRunMacro()
 {
     Create("hello world", "kick tree");
     TestRegister.UpdateValue("dwra");
     _vimBuffer.Process("@c");
     Assert.Equal("aorld", _textView.GetLine(0).GetText());
     _textView.MoveCaretToLine(1);
     _vimBuffer.Process(".");
     Assert.Equal("aick tree", _textView.GetLine(1).GetText());
 }
Example #15
0
 public void RunMacroDuringRecord()
 {
     // Reported in issues #2119 and #2173.
     Create("hello world");
     TestRegister.UpdateValue("dw");
     _vimBuffer.Process("qa@cq");
     Assert.Equal("world", _textView.GetLine(0).GetText());
     Assert.Equal("dw", TestRegister.StringValue);
     Assert.Equal("@c", _vimBuffer.GetRegister('a').StringValue);
 }
Example #16
0
 public void WordCompletionWithNoCompletion()
 {
     Create("z ");
     _textView.MoveCaretTo(1);
     TestRegister.UpdateValue(
         KeyNotationUtil.StringToKeyInput("i"),
         KeyNotationUtil.StringToKeyInput("<C-n>"),
         KeyNotationUtil.StringToKeyInput("s"));
     _vimBuffer.Process("@c");
     Assert.Equal("zs ", _textView.GetLine(0).GetText());
 }
Example #17
0
        public ActionResult _delTestRegisterRecord(TestRegister testRegister)
        {
            IList <Certificate>         certificates = null;
            Dictionary <string, object> queryParams  = new Dictionary <string, object>();

            queryParams.Add("TestRegister", testRegister);
            certificates = certificateRepository.GetByLikeCriteria(queryParams);
            foreach (var item in certificates)
            {
                certificateRepository.Delete(item);
            }
            testRegisterRepository.Delete(testRegister);
            return(null);
        }
Example #18
0
 public void AppendValues()
 {
     Create("");
     TestRegister.UpdateValue("iw");
     _vimBuffer.Process("qCin");
     _vimBuffer.Process(VimKey.Escape);
     _vimBuffer.Process("q");
     Assert.Equal(ModeKind.Normal, _vimBuffer.ModeKind);
     _textView.SetText("");
     _textView.MoveCaretTo(0);
     _vimBuffer.Process("@c");
     Assert.Equal("win", _textView.GetLine(0).GetText());
     Assert.Equal(ModeKind.Normal, _vimBuffer.ModeKind);
     Assert.Equal(2, _textView.GetCaretPoint().Position);
 }
Example #19
0
            public void RightMove()
            {
                Create("cat", "cat");
                _globalSettings.VirtualEdit = string.Empty; // ensure not 've=onemore'
                TestRegister.UpdateValue("llidone", VimKey.Escape);

                // Works because 'll' can get to the end of the line
                _vimBuffer.Process("@c");
                Assert.Equal("cadonet", _textView.GetLine(0).GetText());

                // Fails since the second 'l' fails
                _textView.MoveCaretToLine(1, 2);
                _vimBuffer.Process("@c");
                Assert.Equal("cat", _textView.GetLine(1).GetText());
            }
Example #20
0
        public async Task <ActionResult> CreateApp(AppDeptViewModel vm, IFormCollection collection)
        {
            var app = new TestRegister
            {
                Date      = DateTime.Now,
                PatientId = vm.PatientId,
                TId       = vm.TestId,
                Result    = new TestResult
                {
                    Id = vm.ResultId
                }

                //Patients = new PatientForm
                //{
                //    Fullname = vm.Fullname,
                //    Age = vm.Age,
                //    ClinicalDiagnosis = vm.ClinicalDiagnosis,
                //    DateOfRequest = vm.DateOfRequest,
                //    Physician = new Physician
                //    {
                //        PhysicianName = vm.Physician
                //    }
                //},
                //Tests = /*(from product in _ctx.Tests new PatientTest)*/{

                //},

                //    Result = new TestResult
                //    {
                //        IsCompleted = vm.IsCompleted
                //    },
            };

            try
            {
                _testRepo.AddAppointment(app);
                await _testRepo.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View(app));
            }
        }
Example #21
0
        public ActionResult _addOrEditTestRegister(int id, string testDate, int provaiderId, int nomGroupId, string model)
        {
            TestRegister testReg = testRegisterRepository.Get(id);

            //Если вставляется новая запись, то пытаемся найти запись с выбранным цехом
            if (testReg == null)
            {
                testReg = new TestRegister();
                testReg.OrganizationId = getIntCurrentEnterpriseId();
            }
            testReg.TestDate  = System.DateTime.Parse(testDate);
            testReg.Provaider = provaiderRepository.Get(provaiderId);
            testReg.NomGroup  = nomGroupRepository.Get(nomGroupId);
            testReg.Model     = model;
            // сохраняем изменения
            testRegisterRepository.SaveOrUpdate(testReg);
            return(null);
        }
Example #22
0
        public static TestRegister rebuildTestRegister(TestRegister inTestRegister, List <string> excludeProperty)
        {
            TestRegister testReg = new TestRegister(inTestRegister.Id);

            testReg.TestDate = inTestRegister.TestDate;
            testReg.Model    = inTestRegister.Model;
            if (!isExclude(excludeProperty, "Provaider"))
            {
                testReg.Provaider      = new Provaider(inTestRegister.Provaider.Id);
                testReg.Provaider.Name = inTestRegister.Provaider.Name;
                testReg.Provaider.City = inTestRegister.Provaider.City;
            }
            if (!isExclude(excludeProperty, "NomGroup"))
            {
                testReg.NomGroup = rebuildNomGroup(inTestRegister.NomGroup, rebuildExcludeProperty(excludeProperty, "NomGroup"));
            }
            return(testReg);
        }
        public async Task <ActionResult <TestRegister> > PostTestRegister(TestRegister testRegister)
        {
            _context.TestRegisters.Add(testRegister);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (TestRegisterExists(testRegister.TestRegisterId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetTestRegister", new { id = testRegister.TestRegisterId }, testRegister));
        }
Example #24
0
        public ActionResult _SelectCerticicates(int id)
        {
            IList <Certificate> list = new List <Certificate>();

            if (id > 0)
            {
                Dictionary <string, object> queryParams = new Dictionary <string, object>();
                Dictionary <string, object> orderParams = new Dictionary <string, object>();
                TestRegister        testRegister        = testRegisterRepository.Get(id);
                IList <Certificate> certificates        = null;
                queryParams.Add("TestRegister", testRegister);
                orderParams.Add("DocDate", ASC);
                certificates = certificateRepository.GetByLikeCriteria(queryParams, orderParams);
                foreach (var item in certificates)
                {
                    Certificate cert = rebuildCertificate(item);
                    list.Add(cert);
                }
            }
            return(View(new GridModel(list)));
        }
 public bool AddtoTestRegister(TestRegister test)
 {
     try
     {
         using (regDb = new RegisterDbContext())
         {
             regDb.TestRegisters.Add(test);
             int status = regDb.SaveChanges();
             if (status > 0)
             {
                 Success = true;
             }
             else
             {
             }
         }
         return(Success);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #26
0
        public static void Seed(IServiceProvider serviceProvider)
        {
            using (var context = new AppDbContext(serviceProvider.GetRequiredService <DbContextOptions <AppDbContext> >()))
            {
                //AppDbContext context = applicationBuilder.ApplicationServices.GetRequiredService<AppDbContext>();

                //UserManager<IdentityUser> userManager = serviceProvider.GetRequiredService<UserManager<IdentityUser>>();


                // Add Customers
                //var justin = new PatientForm
                //{
                //var user = new IdentityUser("tenece");
                // userManager.CreateAsync(user, "%ten");

                var mike = new Physician
                {
                    Id            = 2,
                    PhysicianName = "Dave bane"
                };

                context.Physicians.Add(mike);

                var pat = new PatientForm
                {
                    Id                = 1,
                    Fullname          = "Justin Noon",
                    Age               = 27,
                    ClinicalDiagnosis = "RVS",
                    ClinicNo          = 3,

                    DepartmentId = 3,
                    //Test = new PatientTest
                    //{
                    //    t
                    //}
                    //PhysicianId = 2,
                    //Test = 5,


                    //Department = "Infection and Disease"
                };
                context.Patients.Add(pat);

                var arv = new PatientTest
                {
                    TestId       = 5,
                    TestName     = "HIV",
                    DepartmentId = 3
                };
                context.Tests.Add(arv);

                var vir = new TestDepartment
                {
                    DeptId     = 3,
                    Department = "Virus"
                };
                context.Departments.Add(vir);
                //};

                var ruth = new TestRegister
                {
                    Id        = 1,
                    Date      = DateTime.Now,
                    PatientId = 1,
                    TId       = 5,
                    ResultId  = 8
                };
                context.Appointments.Add(ruth);
                var res = new TestResult
                {
                    Id          = 8,
                    IsCompleted = true
                };
                context.Results.Add(res);
                context.SaveChanges();
            }
        }
Example #27
0
 public void AddAppointment(TestRegister reg)
 {
     _appDbContext.Appointments.Add(reg);
 }
Example #28
0
 public void RemoveAppointment(TestRegister reg)
 {
     _appDbContext.Appointments.Remove(reg);
 }
Example #29
0
 public static TestRegister rebuildTestRegister(TestRegister inTestRegister)
 {
     return(rebuildTestRegister(inTestRegister, null));
 }
Example #30
0
 public void UpdateAppointment(TestRegister reg)
 {
     _appDbContext.Appointments.Update(reg);
 }