/// <summary> /// 用户淘宝店授权信息(用户获取淘宝的权限) /// </summary> /// <param name="strMsg"></param> public void getUserTaobao(string[] strMsg) { List <model.taoAppUser> taoAppUserMdList = new List <model.taoAppUser>(); //用户淘宝店授权信息 string access_tokens = strMsg[3].ToString(); string nicks = HttpUtility.UrlDecode(strMsg[2].ToString()); if (!string.IsNullOrEmpty(access_tokens) && !string.IsNullOrEmpty(nicks)) { string[] Access_tokens = access_tokens.Split(','); string[] Nicks = nicks.Split(','); for (int i = 0; i < Access_tokens.Length; i++) { bll.taoAppUserbll taoAppUserBll = new bll.taoAppUserbll(); #region IDataParameter[] iparaNick = new IDataParameter[] { new SqlParameter("tbUserNick", SqlDbType.NVarChar, 200), }; iparaNick[0].Value = Nicks[i]; #endregion //model.taoAppUser taoAppUserMd = taoAppUserBll.GetModelByNick(Nicks[i]); model.taoAppUser taoAppUserMd = taoAppUserBll.GetModelByNick(iparaNick, "taoAppUsersNickSelect"); if (taoAppUserMd == null) { taoAppUserMd = new model.taoAppUser(); } taoAppUserMd.accessToken = Access_tokens[i]; taoAppUserMd.tbUserNick = Nicks[i]; taoAppUserMdList.Add(taoAppUserMd); } } us.TaoAppUserList = taoAppUserMdList; }
/// <summary> /// 得到一个对象实体 /// </summary> public List <model.taoAppUser> DataRowToModel(DataRowCollection rowCollection) { List <model.taoAppUser> list = new List <model.taoAppUser>(); foreach (DataRow row in rowCollection) { model.taoAppUser modelMd = new model.taoAppUser(); if (row != null) { if (row["Id"] != null && row["Id"].ToString() != "") { modelMd.Id = int.Parse(row["Id"].ToString()); } if (row["tbUsserId"] != null) { modelMd.tbUsserId = row["tbUsserId"].ToString(); } if (row["tbUserNick"] != null) { modelMd.tbUserNick = row["tbUserNick"].ToString(); } if (row["accessToken"] != null) { modelMd.accessToken = row["accessToken"].ToString(); } if (row["refreshToken"] != null) { modelMd.refreshToken = row["refreshToken"].ToString(); } if (row["userId1"] != null && row["userId1"].ToString() != "") { modelMd.userId1 = int.Parse(row["userId1"].ToString()); } if (row["userId"] != null && row["userId"].ToString() != "") { modelMd.userId = int.Parse(row["userId"].ToString()); } if (row["Def1"] != null) { modelMd.Def1 = row["Def1"].ToString(); } if (row["Def2"] != null) { modelMd.Def2 = row["Def2"].ToString(); } if (row["Def3"] != null) { modelMd.Def3 = row["Def3"].ToString(); } if (row["Def4"] != null) { modelMd.Def4 = row["Def4"].ToString(); } if (row["Def5"] != null) { modelMd.Def5 = row["Def5"].ToString(); } } list.Add(modelMd); } return(list); }