示例#1
0
    //#region strDecryptPassword
    //public static string strDecryptPassword(string strPassword)
    //{
    //    //return clsDES.strDecrypt(strPassword);
    //    //return clsDES.strDecrypt(strPassword,);
    //}
    //#endregion

    #region intValidateBOUser
    public static Int32 intValidateBOUser(System.Web.UI.Page objPage, string strUserId, string strPassword)
    {
        Int32       intReturnValue;
        clsDBEngine objDB = new clsDBEngine();
        ///string strDec = strDecryptPassword(strPassword);
        string strEncPwd = strEncryptAdminPassword(strPassword);

        objDB.blnParamClear();
        objDB.blnParamAdd(ParameterDirection.Input, "@vcUserId", SqlDbType.VarChar, 50, strUserId);
        objDB.blnParamAdd(ParameterDirection.Input, "@vcPassword", SqlDbType.VarChar, 255, strEncPwd);
        objDB.blnParamAdd(ParameterDirection.Input, "@vcIPAddress", SqlDbType.VarChar, 20, objPage.Request.UserHostAddress.ToString());
        objDB.blnParamAdd(ParameterDirection.Output, "@intBOSessId", SqlDbType.Int, 4, 0);
        objDB.blnParamAdd(ParameterDirection.Output, "@vcCompanyCode", SqlDbType.VarChar, 10, "");
        objDB.blnParamAdd(ParameterDirection.Output, "@vcVenueCode", SqlDbType.VarChar, 10, "");
        objDB.blnParamAdd(ParameterDirection.Output, "@vcEventCode", SqlDbType.VarChar, 10, "");
        objDB.blnParamAdd(ParameterDirection.Output, "@vcAppCode", SqlDbType.VarChar, 20, "");
        intReturnValue = objDB.lngExecuteSP("spBOValidateAdmin");
        if (intReturnValue == 0)
        {
            blnSetCookie(objPage, "BO_SessId", objDB.objParamValue("@intBOSessId").ToString(), objPage.Request.IsSecureConnection);
            blnSetCookie(objPage, "BO_CompanyCode", objDB.objParamValue("@vcCompanyCode").ToString(), objPage.Request.IsSecureConnection);
            blnSetCookie(objPage, "BO_VenueCode", objDB.objParamValue("@vcVenueCode").ToString(), objPage.Request.IsSecureConnection);
            blnSetCookie(objPage, "BO_EventCode", objDB.objParamValue("@vcEventCode").ToString(), objPage.Request.IsSecureConnection);
            blnSetCookie(objPage, "BO_AppCode", objDB.objParamValue("@vcAppCode").ToString(), objPage.Request.IsSecureConnection);
            blnSetCookie(objPage, "BO_UserId", strUserId, objPage.Request.IsSecureConnection);
        }
        objDB.blnCloseConnection();
        objDB = null;
        return(intReturnValue);
    }
示例#2
0
    public static string strBORights(System.Web.UI.Page objPage, string strMenuName)
    {
        clsDBEngine objDB     = new clsDBEngine();
        string      strRights = "";

        objDB.blnParamClear();
        objDB.blnParamAdd(ParameterDirection.Input, "@strUserId", SqlDbType.VarChar, 50, strGetCookie(objPage, "BO_UserId", ""));
        objDB.blnParamAdd(ParameterDirection.Input, "@strModuleName", SqlDbType.VarChar, 20, strMenuName);
        objDB.blnParamAdd(ParameterDirection.Output, "@strRights", SqlDbType.VarChar, 10, "");
        if (objDB.lngExecuteSP("spBOGetRights") == 0)
        {
            strRights = objDB.objParamValue("@strRights").ToString();
        }
        objDB.blnCloseConnection();
        return(strRights);
    }
示例#3
0
    public bool blnUserIsAuth(string strUser, string strCompany, string strCinemaID, string strEventCode, string strDebtId)
    {
        const string udcErrorMethod = "blnUserIsAuth";

        try
        {
            Int32 intReturnValue;

            objDB.blnParamClear();
            objDB.blnParamAdd(ParameterDirection.Input, "@strUserId", SqlDbType.VarChar, 50, strUser);
            objDB.blnParamAdd(ParameterDirection.Input, "@strCompanyCode", SqlDbType.VarChar, 10, strCompany);
            objDB.blnParamAdd(ParameterDirection.Input, "@strCinemaID", SqlDbType.VarChar, 10, strCinemaID);
            objDB.blnParamAdd(ParameterDirection.Input, "@strEventCode", SqlDbType.VarChar, 10, strEventCode);
            objDB.blnParamAdd(ParameterDirection.Input, "@strDebt_Id", SqlDbType.VarChar, 6, strDebtId);
            objDB.blnParamAdd(ParameterDirection.Output, "@strRights", SqlDbType.VarChar, 20, "");

            intReturnValue = objDB.lngExecuteSP("spBOCheckRights");
            if (intReturnValue == 0)
            {
                string strRights = objDB.objParamValue("@strRights").ToString();
                clsLog.blnLogInfo(udcErrorSource, udcErrorMethod, "Checking user is authorised - Sucess, Rights -" + strRights, "User Id = " + strUser + " Company Code = " + strCompany + " Cinema ID = " + strCinemaID + " EventCode = " + strEventCode + " Debt Id = " + strDebtId);
                return(true);
            }
            else
            {
                clsLog.blnLogInfo(udcErrorSource, udcErrorMethod, "Checking user is authorised - Fail", "User Id = " + strUser + " Company Code = " + strCompany + " Cinema ID = " + strCinemaID + " EventCode = " + strEventCode + " Debt Id = " + strDebtId);
                return(false);
            }
        }
        catch (Exception ex)
        {
            clsLog.blnLogError(udcErrorSource, udcErrorMethod, "Error in checking user is Authorised.", ex.ToString(), false);
            return(false);
        }
        objDB.blnCloseConnection();
        objDB = null;
    }