Exemplo n.º 1
0
        /// <summary>
        ///  6、	添加用户
        /// </summary>
        /// <param name="token"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        /// Gerry Ge
        /// 请求方式:POST
        public string AddUser(string token, UserAddResponseDataEntity user)
        {
            string             strResponse = string.Empty;
            UserJoinedResponse apiResponse = new UserJoinedResponse();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                foreach (System.Reflection.PropertyInfo p in user.GetType().GetProperties())
                {
                    if (p.Name == "hospitalid")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "role")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "idcard")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "username")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "mobile")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "email")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "deptname")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "duty")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                    else if (p.Name == "tel")
                    {
                        sPara.Add(p.Name, p.GetValue(user).ToString());
                    }
                }

                strResponse = F8YLSubmit.BuildRequest(sPara, "ucenter/user/add?token=" + token);
            }
            catch (Exception)
            {
            }
            return(strResponse);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 49、	获取病人加入的项目
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        /// Gerry Ge
        /// 请求方式:GET
        public string Joined(string token, int page = 1)
        {
            string             strResponse = string.Empty;
            UserJoinedResponse apiResponse = new UserJoinedResponse();

            try
            {
                Dictionary <string, string> sPara = new Dictionary <string, string>();
                sPara.Add("page", page.ToString());

                strResponse = F8YLSubmit.BuildGetRequest(sPara, "ucenter/user/joined?token=" + token);
            }
            catch (Exception)
            {
            }
            return(strResponse);
        }