Exemplo n.º 1
0
        public ActionResult <Person> EditPerson(Person todoItem)
        {
            InitiateDevice initDev = new InitiateDevice();

            initDev.Login();

            Dictionary <string, dynamic> Valid = new Dictionary <string, dynamic>();

            Valid.Add("enable", todoItem.userInfo.valid.enable);
            Valid.Add("beginTime", todoItem.userInfo.valid.beginTime);
            Valid.Add("endTime", todoItem.userInfo.valid.endTime);
            Valid.Add("timeType", todoItem.userInfo.valid.timeType);

            var userInfo = new
            {
                employeeNo = todoItem.userInfo.employeeNo,
                name       = todoItem.userInfo.name,
                userType   = todoItem.userInfo.userType,
                Valid      = Valid,
                checkUser  = todoItem.userInfo.checkUser,
                addUser    = todoItem.userInfo.addUser
            };

            var strJson = JsonConvert.SerializeObject(userInfo); //convert object -> string

            Console.WriteLine(strJson);

            PersonManageTest personManageTest = new PersonManageTest();

            personManageTest.EditPerson(IpAddress, UserName, Password, Port, userInfo);
            //personManageTest.AddPerson();

            return(todoItem);
        }
Exemplo n.º 2
0
        public ActionResult Ping()
        {
            InitiateDevice initDev = new InitiateDevice();

            initDev.Login();

            PersonManageTest personManageTest = new PersonManageTest();

            string str = personManageTest.SearchPerson(IpAddress, UserName, Password, Port);

            // string last = Convert.ToString(str);

            return(Content(str));
            //initDev.Logout();
        }