public RetModel Register(UserInfo user)
 {
     Sys_UserInfoBLL bll = new Sys_UserInfoBLL();
     Sys_UserInfo model = new Sys_UserInfo()
     {
         UserName = user.UserName,
         Password = user.Password,
         Email = user.Email,
         Phone = user.Phone
     };
     int result = bll.Add(model);
     RetModel retmodel = new RetModel();
     switch (result)
     {
         case 0:
             retmodel.StatusCode = Convert.ToInt32(ResultType.userIsExist).ToString();
             break;
         case -1:
             retmodel.StatusCode = Convert.ToInt32(ResultType.EmailIsExist).ToString();
             break;
         case -2:
             retmodel.StatusCode = Convert.ToInt32(ResultType.PhoneIsExist).ToString();
             break;
         default:
             retmodel.StatusCode = Convert.ToInt32(ResultType.success).ToString();
             retmodel.RetValue = RongCloudServer.GetToken(appKey, appSecret, model.ID, model.UserName, "http://www.qqw21.com/article/UploadPic/2012-11/201211259378560.jpg");
             break;
     }
     return retmodel;
 }
 public RetModel Login(string username, string password)
 {
     Sys_UserInfoBLL bll = new Sys_UserInfoBLL();
     int result = 0;
     string userid = "";
     result = bll.Login(username, password, ref userid);
     RetModel retmodel = new RetModel();
     switch (result)
     {
         case 0:
             retmodel.StatusCode = Convert.ToInt32(ResultType.MemberNotFound).ToString();
             break;
         case -1:
             retmodel.StatusCode = Convert.ToInt32(ResultType.nameOrPwdIsError).ToString();
             break;
         default:
             retmodel.StatusCode = Convert.ToInt32(ResultType.success).ToString();
             retmodel.RetValue = RongCloudServer.GetToken(appKey, appSecret, userid, username, "");
             break;
     }
     return retmodel;
 }