Exemplo n.º 1
0
    private bool CreatePointsProgram(PointsProgram pointsProgram)
    {
        bool result           = false;
        SQLParametersList lst = new SQLParametersList();

        try
        {
            lst.Add("@CAMProgram", SqlDbType.Bit).Value      = 0;
            lst.Add("@ExternalProgram", SqlDbType.Bit).Value = 0;
            lst.Add("@AutoDelete", SqlDbType.Bit).Value      = 1;

            if (pointsProgram.ProgramID == 0)
            {
                lst.Add("@ProgramName", SqlDbType.NVarChar, 200).Value = pointsProgram.ProgramName;
                lst.Add("@ProgramID", SqlDbType.BigInt).Direction      = ParameterDirection.Output;
                m_dbAccess.ExecuteNonQuery(DataBases.LogixRT, CommandType.StoredProcedure, "pt_PointsPrograms_Insert", lst);
                pointsProgram.ProgramID = lst["@ProgramID"].Value.ConvertToLong();
                result = true;
                if (MyCommon.LRTadoConn.State == ConnectionState.Closed)
                {
                    MyCommon.Open_LogixRT();
                }
                MyCommon.Activity_Log(7, pointsProgram.ProgramID, CurrentUser.AdminUser.ID, Copient.PhraseLib.Lookup("history.point-create", LanguageID));

                lst = new SQLParametersList();
                lst.Add("@ProgramID", SqlDbType.NVarChar, 200).Value = pointsProgram.ProgramID;
                lst.Add("@VarID", SqlDbType.BigInt).Direction        = ParameterDirection.Output;
                m_dbAccess.ExecuteNonQuery(DataBases.LogixXS, CommandType.StoredProcedure, "dbo.pc_PointsVar_Create", lst);
                long PromoVarID = lst["@VarID"].Value.ConvertToLong();

                if (PromoVarID != 0)
                {
                    MyCommon.QueryStr = " update PointsPrograms with (RowLock) SET " +
                                        " PromoVarID=" + PromoVarID + " " + " where ProgramID=" + pointsProgram.ProgramID + ";";
                    MyCommon.LRT_Execute();
                }
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            MyCommon.Close_LogixRT();
        }
        lst = null;
        return(result);
    }
Exemplo n.º 2
0
    private bool CreateSVPointsProgram(CMS.AMS.Models.SVProgram SVPointsProgram)
    {
        bool result           = false;
        SQLParametersList lst = new SQLParametersList();

        try
        {
            if (SVPointsProgram.SVProgramID == 0)
            {
                lst.Add("@Name", SqlDbType.NVarChar, 200).Value        = SVPointsProgram.ProgramName;
                lst.Add("@Description", SqlDbType.NVarChar, 200).Value = "";
                lst.Add("@ExpirePeriod", SqlDbType.Int).Value          = 1;
                lst.Add("@Value", SqlDbType.NVarChar, 200).Value       = "1";
                lst.Add("@OneUnitPerRec", SqlDbType.Bit).Value         = 0;
                lst.Add("@SVExpireType", SqlDbType.Int).Value          = 1;
                lst.Add("@SVExpirePeriodType", SqlDbType.Int).Value    = 1;
                lst.Add("@ExpireTOD", SqlDbType.VarChar, 5).Value      = "";
                lst.Add("@ExpireDate", SqlDbType.DateTime).Value       = Convert.ToDateTime("12/31/2025 23:59");
                lst.Add("@ExpireCentralServerTZ", SqlDbType.Bit).Value = 0;
                lst.Add("@SVTypeID", SqlDbType.Int).Value                  = 1;
                lst.Add("@UOMLimit", SqlDbType.Int).Value                  = 1;
                lst.Add("@AllowReissue", SqlDbType.Int).Value              = 0;
                lst.Add("@ScorecardID", SqlDbType.Int).Value               = 0;
                lst.Add("@ScorecardDesc", SqlDbType.NVarChar, 100).Value   = "";
                lst.Add("@ScorecardBold", SqlDbType.Bit).Value             = 1;
                lst.Add("@DisallowRedeemInEarnTrans", SqlDbType.Int).Value = 0;
                lst.Add("@AllowNegativeBal", SqlDbType.Int).Value          = 0;
                lst.Add("@AdjustmentUPC", SqlDbType.NVarChar, 100).Value   = "";
                lst.Add("@RedemptionRestrictionID", SqlDbType.Int).Value   = 0;
                lst.Add("@MemberRedemptionID", SqlDbType.Int).Value        = 0;
                lst.Add("@SVProgramID", SqlDbType.BigInt).Direction        = ParameterDirection.Output;

                m_dbAccess.ExecuteNonQuery(DataBases.LogixRT, CommandType.StoredProcedure, "pt_StoredValuePrograms_Insert", lst);
                SVPointsProgram.SVProgramID = lst["@SVProgramID"].Value.ConvertToLong();
                result = true;
                if (MyCommon.LRTadoConn.State == ConnectionState.Closed)
                {
                    MyCommon.Open_LogixRT();
                }
                MyCommon.Activity_Log(26, SVPointsProgram.SVProgramID, CurrentUser.AdminUser.ID, Copient.PhraseLib.Lookup("history-sv-create", LanguageID));
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            MyCommon.Close_LogixRT();
        }

        lst = null;
        return(result);
    }
Exemplo n.º 3
0
    public void Application_Start(object sender, EventArgs e)
    {
        //Initialize NEP Application
        NepServiceApplication.Init();

        WebApiConfig.Register(GlobalConfiguration.Configuration);

        // Code that runs on application startup
        CMS.AMS.ResolverBuilder resolver = new ResolverBuilder();
        CurrentRequest.Resolver         = resolver.GetResolver();
        CurrentRequest.Resolver.AppName = "Global.asax";
        IDBAccess         m_dbaccess = CurrentRequest.Resolver.Resolve <DBAccess>();
        SQLParametersList paramlist  = new SQLParametersList();
        String            QueryStr   = "Update Folders set MassOperationStatus = '~FNIU~'";

        m_dbaccess.ExecuteNonQuery(DataBases.LogixRT, CommandType.Text, QueryStr, paramlist);

        //Adding health monitors
        InitializeHealthMonitors();
        HealthOptions.AddHealthMonitors(componentHealthMonitors.ToArray());
    }