public int LoginCheck(Wms_Login request) { int Result = -1; try { using (var db = DbConnectionFactory.OpenDbConnection("WMS")) { if (request.UpdateAllString != null && request.UpdateAllString != "") { JArray ja = (JArray)JsonConvert.DeserializeObject(request.UpdateAllString); if (ja != null) { for (int i = 0; i < ja.Count(); i++) { string strSqlSaus1 = ""; string strUserId = ja[i]["UserId"].ToString(); string strPassword = ja[i]["Password"].ToString(); //strSqlSaus1 = "Select count(*) From Saus1 Where UserId='" + Modfunction.CheckNull(strUserId) + "' And Password='******'"; strSqlSaus1 = "Select count(*) From Saus1 Where UserId='" + Modfunction.CheckNull(strUserId) + "'"; Result = db.Scalar <int>(strSqlSaus1); } } } } } catch { throw; } return(Result); }
public int LoginCheck(Wms_Login request) { int Result = -1; try { using (var db = DbConnectionFactory.OpenDbConnection("WMS")) { Result = db.Scalar <int>( "Select count(*) From Saus1 Where UserId={0} And Password={1}", request.UserId, request.Password ); } } catch { throw; } return(Result); }
public int LoginCheck(Wms_Login request) { int Result = -1; try { using (var db = DbConnectionFactory.OpenDbConnection()) { string strSql = "Select count(*) From Saus1 Where UserId='" + request.UserId + "' And Password="******"'" + request.Password + "'"; } else { strSql = strSql + "'" + request.Md5Stamp + "'"; } Result = db.Scalar <int>(strSql); } } catch { throw; } return(Result); }