Exemple #1
0
 protected void btnLoginCS_Click(object sender, EventArgs e)
 {
     if (Request.Cookies["m_userid"] != null)
     {
         string sUserName = Request.Cookies["m_username"].Value;
         string sPwd      = Request.Cookies["m_pwd"].Value;
         if (string.IsNullOrEmpty(sUserName) || string.IsNullOrEmpty(sPwd))
         {
             Response.Redirect("Login.aspx?err=4012", true);
             return;
         }
         if (!SqlFilter.Filter.ProcessFilter(ref sUserName) || !SqlFilter.Filter.ProcessFilter(ref sPwd))
         {
             Response.Redirect("Login.aspx?err=4002", true);
             return;
         }
         int iType = BllSql.RunSqlScalar("select UserTypeID from usermain where username = '******' and Password='******'");
         if (iType == 3)
         {
             Response.Redirect("Login.aspx?err=4015", true);
             return;
         }
         Session["m_userid"] = Request.Cookies["m_userid"].Value;
         Response.Redirect("MngIndex.aspx", true);
     }
 }
Exemple #2
0
    public static int GetVehicleUsage(int iUserID, string sDbName, ref string strGroupList)
    {
        string strSQL = "";

        try
        {
            if (iUserID == 1)
            {
                strSQL = "SELECT count(1) from " + sDbName + ".dbo.VehOnline  ";
            }
            else
            {
                //取所有列表ID
                //If sVersion = "SZHZ" Then
                //    strGroupList = GetAllVehGroupByGroup_UserID(adoConn, iUserID, sUserName)
                if (strGroupList == "-1")
                {
                    strGroupList = GetAllVehGroupByUserID(iUserID);
                    if (strGroupList.Trim().Length == 0)
                    {
                        strGroupList = "0";
                    }
                }
                strSQL = "SELECT count(1) from VehicleDetail INNER JOIN " + sDbName + ".dbo.VehOnline as a ON VehicleDetail.VehID = a.VehID where VehicleDetail.VehGroupID in (" + strGroupList + ") ";
            }

            int iCount = BllSql.RunSqlScalar(strSQL);
            return(iCount);
        }
        catch (Exception ex)
        {
            return(0);
        }
    }