public async Task <IActionResult> PutUsersTest(int usersTestId, UsersTest usersTest)
        {
            if (usersTestId != usersTest.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 2
0
    public void Start()
    {
        Thread t1 = new Thread(new ThreadStart(MainLoop));

        SetUpManagers();
        usersTest = new UsersTest(this);
        t1.Start();
    }
        public ActionResult <UsersTest> PostUsersTest(UsersTest usersTest)
        {
            usersTest.User = _context.User.FirstOrDefault(u => u.Email == usersTest.User.Email);
            if (usersTest.User == null)
            {
                return(StatusCode(404));
            }
            usersTest.UserId = usersTest.User.Id;
            _context.UsersTest.Add(usersTest);
            var result = _context.SaveChanges();

            if (result == 0)
            {
                return(StatusCode(500));
            }
            return(StatusCode(200));
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            //UsersTest.testGuardar();
            if (UsersTest.testLogin())
            {
                UsersTest.testUpdateLastAccessDate();
                EmployeesTest.testSave();
                GeneralTest.testSave();
            }
            //UsersTest.testUpdateAll();
            //UsersTest.testCambiarContrasena();
            //UsersTest.testFindAll();


            UsersTest.ShowOneWithRelationships();
            Console.WriteLine();
            EmployeesTest.ShowOneWithRelationships();


            Console.WriteLine("Press ENTER to continue...");
            Console.Read();
        }
Exemplo n.º 5
0
 /// <summary>
 /// 创建用户名数据传输对象2
 /// </summary>
 /// <param name="id">用户名编号</param>
 public static UsersDto Create2(string id = "")
 {
     return(UsersTest.Create2(id).ToDto());
 }