static public bool GetUseridAndQuery(int type, String str, MailInfoCfg cfg) { ReleaseList(); bool bFlag = DbFunc.IfConnDb(cfg); if (bFlag) { SplitUserStr(type, str); CheckUserSql(cfg); } return(bFlag); }
static public void CheckUserSql(MailInfoCfg cfg) { foreach (UserInfo user in userList) { String strSql = "select id from account_user where "; try { switch (user.eType) { case EUserType.eUser_Id: { strSql += "id=" + Convert.ToInt64(user.obj) + ";"; } break; case EUserType.eUser_Name: { strSql += "user_name='" + Convert.ToString(user.obj) + "';";; } break; case EUserType.eUser_Account: { strSql += "cdkey='" + Convert.ToString(user.obj) + "';"; } break; default: break; } } catch (System.Exception ex) { errorStr.Add(user.obj.ToString()); continue; } UInt64 objIdx = DbFunc.CheckAndGetUserIdx(strSql); if (objIdx > 0) { if (!userIdList.Contains(objIdx)) { userIdList.Add(objIdx); existUserList.Add(user); } } else { errorStr.Add(user.obj.ToString()); } } }