text:
#pragma once
#include <aws/iam/IAM_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/iam/model/ResponseMetadata.h>
#include <aws/iam/model/MFADevice.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Xml
{
  class XmlDocument;
} // namespace Xml
} // namespace Utils
namespace IAM
{
namespace Model
{
  /**
   *
Contains the response to a successful ListMFADevices request.
   *

See Also:
   AWS
   * API Reference

   */
  class AWS_IAM_API ListMFADevicesResult
  {
  public:
    ListMFADevicesResult();
    ListMFADevicesResult(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);
    ListMFADevicesResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Xml::XmlDocument>& result);

    /**
     *
A list of MFA devices.

     */
    inline const Aws::Vector<MFADevice>& GetMFADevices() const{ return m_mFADevices; }

    /**
     *
A list of MFA devices.

     */
    inline void SetMFADevices(const Aws::Vector<MFADevice>& value) { m_mFADevices = value; }

    /**
     *
A list of MFA devices.

     */
    inline void SetMFADevices(Aws::Vector<MFADevice>&& value) { m_mFADevices = std::move(value); }

    /**
     *
A list of MFA devices.

     */
    inline ListMFADevicesResult& WithMFADevices(const Aws::Vector<MFADevice>& value) { SetMFADevices(value); return *this;}

    /**
     *
A list of MFA devices.

     */
    inline ListMFADevicesResult& WithMFADevices(Aws::Vector<MFADevice>&& value) { SetMFADevices(std::move(value)); return *this;}

    /**
     *
A list of MFA devices.

     */
    inline ListMFADevicesResult& AddMFADevices(const MFADevice& value) { m_mFADevices.push_back(value); return *this; }

    /**
     *
A list of MFA devices.

     */
    inline ListMFADevicesResult& AddMFADevices(MFADevice&& value) { m_mFADevices.push_back(std::move(value)); return *this; }

    /**
     *
A flag that indicates whether there are more items to return. If your results
     * were truncated, you can make a subsequent pagination request using the
     * Marker request parameter to retrieve more items. Note that IAM
     * might return fewer than the MaxItems number of results even when
     * there are more results available. We recommend that you check
     * IsTruncated after every call to ensure that you receive all of your
     * results.

     */
    inline bool GetIsTruncated() const{ return m_isTruncated; }

    /**
     *
A flag that indicates whether there are more items to return. If your results
     * were truncated, you can make a subsequent pagination request using the
     * Marker request parameter to retrieve more items. Note that IAM
     * might return fewer than the MaxItems number of results even when
     * there are more results available. We recommend that you check
     * IsTruncated after every call to ensure that you receive all of your
     * results.

     */
    inline void SetIsTruncated(bool value) { m_isTruncated = value; }

    /**
     *
A flag that indicates whether there are more items to return. If your results
     * were truncated, you can make a subsequent pagination request using the
     * Marker request parameter to retrieve more items. Note that IAM
     * might return fewer than the MaxItems number of results even when
     * there are more results available. We recommend that you check
     * IsTruncated after every call to ensure that you receive all of your
     * results.

     */
    inline ListMFADevicesResult& WithIsTruncated(bool value) { SetIsTruncated(value); return *this;}

    /**
     *
When IsTruncated is true, this element is present
     * and contains the value to use for the Marker parameter in a
     * subsequent pagination request.

     */
    inline const Aws::String& GetMarker() const{ return m_marker; }

    /**
     *
When IsTruncated is true, this element is present
     * and contains the value to use for the Marker parameter in a
     * subsequent pagination request.

     */
    inline void SetMarker(const Aws::String& value) { m_marker = value; }

    /**
     *
When IsTruncated is true, this element is present
     * and contains the value to use for the Marker parameter in a
     * subsequent pagination request.

     */
    inline void SetMarker(Aws::String&& value) { m_marker = std::move(value); }

    /**
     *
When IsTruncated is true, this element is present
     * and contains the value to use for the Marker parameter in a
     * subsequent pagination request.

     */
    inline void SetMarker(const char* value) { m_marker.assign(value); }

    /**
     *
When IsTruncated is true, this element is present
     * and contains the value to use for the Marker parameter in a
     * subsequent pagination request.

     */
    inline ListMFADevicesResult& WithMarker(const Aws::String& value) { SetMarker(value); return *this;}

    /**
     *
When IsTruncated is true, this element is present
     * and contains the value to use for the Marker parameter in a
     * subsequent pagination request.

     */
    inline ListMFADevicesResult& WithMarker(Aws::String&& value) { SetMarker(std::move(value)); return *this;}

    /**
     *
When IsTruncated is true, this element is present
     * and contains the value to use for the Marker parameter in a
     * subsequent pagination request.

     */
    inline ListMFADevicesResult& WithMarker(const char* value) { SetMarker(value); return *this;}

    inline const ResponseMetadata& GetResponseMetadata() const{ return m_responseMetadata; }

    inline void SetResponseMetadata(const ResponseMetadata& value) { m_responseMetadata = value; }

    inline void SetResponseMetadata(ResponseMetadata&& value) { m_responseMetadata = std::move(value); }

    inline ListMFADevicesResult& WithResponseMetadata(const ResponseMetadata& value) { SetResponseMetadata(value); return *this;}

    inline ListMFADevicesResult& WithResponseMetadata(ResponseMetadata&& value) { SetResponseMetadata(std::move(value)); return *this;}

  private:

    Aws::Vector<MFADevice> m_mFADevices;

    bool m_isTruncated;

    Aws::String m_marker;

    ResponseMetadata m_responseMetadata;
  };

} // namespace Model
} // namespace IAM
} // namespace Aws


text:
enum KnownItemSections {
    ItemInfoSection,
    RecipeSection,
    AlternativesSection,
    KnownItemBarcodeInfoSection,
    KNOWN_NUM_SECTIONS
};

enum ItemInfoSection {
    ItemInfo,
    NUM_INFO_ROWS
};

@interface KnownItemViewController : UITableViewController {
    NSDictionary *barcodeInfo;
}

@property (nonatomic, retain) NSDictionary *barcodeInfo;
@property (retain, nonatomic) IBOutlet UILabel *itemNameLabel;
@property (retain, nonatomic) IBOutlet UILabel *seasonInfoLabel;
@property (retain, nonatomic) IBOutlet UIActivityIndicatorView *seasonActivityIndicator;
@property (retain, nonatomic) IBOutlet UITableViewCell *itemInfoCell;

@end

redpajama_set_name: RedPajamaGithub


text:
package components // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/components"

import (
	"go.opentelemetry.io/collector/component"
)

func extraReceivers() []component.ReceiverFactory {
	// Disable all unstable components.
	return nil
}


text:
<!DOCTYPE html>

    <meta charset="utf-8"/>
    <title>OkanshiMonitor - Okanshi</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content=""/>
    <meta name="author" content="Kim Christensen, Kasper B. Graversen"/>

    <link href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet"/>

    <link type="text/css" rel="stylesheet" href="/Okanshi/content/style.css" />

fsharp.org

github page

Okanshi

OkanshiMonitor

    Namespace: Okanshi

            Attributes:

[<AbstractClass>]

[<Sealed>]

Global monitor factory

Static members

Static member	Description

            AverageGauge(name, tags)

            Signature: (name:string * tags:Tag array) -> AverageGauge

Get or create a AverageGauge with custom tags

            AverageGauge(name)

            Signature: name:string -> AverageGauge

Get or create a AverageGauge

            Counter(name, tags)

            Signature: (name:string * tags:Tag array) -> Counter

Get or create a PeakRateCounter with custom tags

            Counter(name)

            Signature: name:string -> Counter

Get or create a PeakRateCounter

            CumulativeCounter(name, tags)

            Signature: (name:string * tags:Tag array) -> CumulativeCounter

Get or create a CumulativeCounter with custom tags

            CumulativeCounter(name)

            Signature: name:string -> CumulativeCounter

Get or create a CumulativeCounter

            DecimalGauge(name, tags)

            Signature: (name:string * tags:Tag array) -> DecimalGauge

Get or create a DecimalGauge with custom tags

            DecimalGauge(name)

            Signature: name:string -> DecimalGauge

Get or create a DecimalGauge

            DefaultTags()

            Signature: unit -> ISet<Tag>

Gets the default tags added to all monitors created
Sets the default tags added to all monitors created

CompiledName: set_DefaultTags

            DefaultTags()

            Signature: unit -> unit

Gets the default tags added to all monitors created

CompiledName: get_DefaultTags

            DoubleCounter(name, tags)

            Signature: (name:string * tags:Tag array) -> DoubleCounter

Get or create a DoubleCounter

            DoubleCounter(name)

            Signature: name:string -> DoubleCounter

Get or create a DoubleCounter

            DoubleGauge(name, tags)

            Signature: (name:string * tags:Tag array) -> DoubleGauge

Get or create a DoubleGauge with custom tags

            DoubleGauge(name)

            Signature: name:string -> DoubleGauge

Get or create a DoubleGauge

            Gauge(name, getValue, tags)

            Signature: (name:string * getValue:Func<'T> * tags:Tag array) -> Gauge<'T>

                          Type parameters: 'T

Get or create a Gauge with custom tags

            Gauge(name, getValue)

            Signature: (name:string * getValue:Func<'T>) -> Gauge<'T>

                          Type parameters: 'T

Get or create a Gauge

            LongGauge(name, tags)

            Signature: (name:string * tags:Tag array) -> LongGauge

Get or create a LongGauge

            LongGauge(name)

            Signature: name:string -> LongGauge

Get or create a LongGauge

            MaxGauge(name, tags)

            Signature: (name:string * tags:Tag array) -> MaxGauge

Get or create a MaxGaug with custom tags

            MaxGauge(name)

            Signature: name:string -> MaxGauge

Get or create a MaxGauge

            MinGauge(name, tags)

            Signature: (name:string * tags:Tag array) -> MinGauge

Get or create a MinGauge with custom tags

            MinGauge(name)

            Signature: name:string -> MinGauge

Get or create a MinGauge

            MinMaxAvgGauge(name, tags)

            Signature: (name:string * tags:Tag array) -> MinMaxAvgGauge

Get or create a MinMaxAvgGauge with custom tags

            MinMaxAvgGauge(name)

            Signature: name:string -> MinMaxAvgGauge

Get or create a MinMaxAvgGauge with custom tags

            PerformanceCounter(...)

            Signature: (counterConfig:PerformanceCounterConfig * name:string * tags:Tag array) -> PerformanceCounterMonitor

Get or create a performance counter monitor with custom tags

            PerformanceCounter(check, name)

            Signature: (check:PerformanceCounterConfig * name:string) -> PerformanceCounterMonitor

Get or create a performance counter monitor

            SlaTimer(name, sla, tags)

            Signature: (name:string * sla:TimeSpan * tags:Tag array) -> SlaTimer

Get or create a SLA-Timer with custom tags

            SlaTimer(name, sla)

            Signature: (name:string * sla:TimeSpan) -> SlaTimer

Get or create a SLA-Timer, with a step size of 1 minute

            Timer(name, tags)

            Signature: (name:string * tags:Tag array) -> Timer

Get or create a Timer with custom tags

            Timer(name)

            Signature: name:string -> Timer

Get or create a Timer, with a step size of 1 minute

            WithAbsentFiltering

            Signature: AbsentMeasurementsFilterFactory

factory for zero value filtering

CompiledName: get_WithAbsentFiltering

Okanshi

Home page

Get Library via NuGet

Source Code on GitHub

License

Release Notes

Getting started

Sample tutorial

Documentation

API Reference


text:
@interface DeepChildrenTests : RaptureTestSuite {
}

@end

@implementation DeepChildrenTests

- (void)testQuery {
    RXMLElement *rxml = [self testXML];
    __block NSInteger i = 0;

    // count the players
    RXMLElement *players = [rxml child:@"players"];
    NSArray *children = [players children:@"player"];

    [rxml iterateElements:children usingBlock: ^(RXMLElement *e) {
        i++;
    }];

    XCTAssertEqual(i, 9);
}

- (void)testDeepChildQuery {
    RXMLElement *rxml = [self testXML];

    // count the players
    RXMLElement *coachingYears = [rxml child:@"players.coach.experience.years"];

    XCTAssertEqual(coachingYears.textAsInt, 1);
}

- (void)testDeepChildQueryWithWildcard {
    RXMLElement *rxml = [self testXML];

    // count the players
    RXMLElement *coachingYears = [rxml child:@"players.coach.experience.teams.*"];

    // first team returned
    XCTAssertEqual(coachingYears.textAsInt, 53);
}

@end


text:
package org.orienteer.core;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.orienteer.core.dao.DAO;
import org.orienteer.core.tasks.IOConsoleTask;
import org.orienteer.core.tasks.IOTaskSessionPersisted;
import org.orienteer.core.tasks.ITaskSession;
import org.orienteer.core.tasks.ITaskSession.Status;
import org.orienteer.core.tasks.ITestTask;
import org.orienteer.core.tasks.OTaskSessionRuntime;
import org.orienteer.junit.OrienteerTestRunner;

import com.google.inject.Singleton;
import com.orientechnologies.orient.core.db.ODatabaseSession;

import ru.ydn.wicket.wicketorientdb.OrientDbWebSession;

@RunWith(OrienteerTestRunner.class)
@Singleton

public class OTasksTest {
	static final private String CONSOLE_TEST_COMMAND = "ping 127.0.0.1";
	static final private int CONSOLE_TASK_DELAY = 5000;

	@Test
	public void testSimpleSession() throws Exception {
		ITaskSession session = OTaskSessionRuntime.simpleSession(null);
		assertEquals(Status.NOT_STARTED, session.getStatus());
		assertEquals(Status.DETACHED, session.getOTaskSessionPersisted().getStatus());
		IOTaskSessionPersisted persisted = session.getOTaskSessionPersisted();
		assertNull(persisted.getStartTimestamp());
		assertNull(persisted.getFinishTimestamp());
		session.start();
		assertEquals(Status.RUNNING, session.getStatus());
		assertEquals(Status.RUNNING, session.getOTaskSessionPersisted().getStatus());
		assertNotNull(persisted.getStartTimestamp());
		assertNull(persisted.getFinishTimestamp());
		assertFalse(session.isInterruptable());
		session.finish();
		try { Thread.sleep(500);} catch (InterruptedException e) {}
		assertEquals(Status.FINISHED, session.getStatus());
		assertEquals(Status.FINISHED, session.getOTaskSessionPersisted().getStatus());
		assertNotNull(persisted.getStartTimestamp());
		assertNotNull(persisted.getFinishTimestamp());
	}

	@Test
	public void testThreadedSession() throws Exception {
		final ITaskSession session = OTaskSessionRuntime.simpleSession(null);
		assertEquals(Status.NOT_STARTED, session.getStatus());
		IOTaskSessionPersisted persisted = session.getOTaskSessionPersisted();
		assertEquals(Status.DETACHED, session.getOTaskSessionPersisted().getStatus());
		assertNull(persisted.getStartTimestamp());
		assertNull(persisted.getFinishTimestamp());
		new Thread(new Runnable() {

			@Override
			public void run() {
				session.start();
				try { Thread.sleep(1000);} catch (InterruptedException e) {}
				session.finish();
			}
		}).start();
		try { Thread.sleep(100);} catch (InterruptedException e) {}
		assertEquals(Status.RUNNING, session.getStatus());
		assertEquals(Status.RUNNING, session.getOTaskSessionPersisted().getStatus());
		assertNotNull(persisted.getStartTimestamp());
		assertNull(persisted.getFinishTimestamp());
		assertFalse(session.isInterruptable());
		try { Thread.sleep(2000);} catch (InterruptedException e) {}
		assertEquals(Status.FINISHED, session.getStatus());
		assertEquals(Status.FINISHED, session.getOTaskSessionPersisted().getStatus());
		assertNotNull(persisted.getStartTimestamp());
		assertNotNull(persisted.getFinishTimestamp());
	}

	@Test
	@Ignore
	public void taskTestAndTaskSessionTest() throws Exception{
		assertTrue(OrientDbWebSession.get().signIn("admin", "admin"));
		ODatabaseSession db = OrientDbWebSession.get().getDatabaseSession();
		assertFalse(db.isClosed());
		db.commit();

		ITestTask.init(db);

		try{
			ITestTask task = DAO.create(ITestTask.class);
			task.setAutodeleteSessions(false);
			task.save();

			OTaskSessionRuntime<IOTaskSessionPersisted> taskSession = task.startNewSession();

			IOTaskSessionPersisted persisted = taskSession.getOTaskSessionPersisted();

			assertNotNull(persisted.getThreadName());
			assertEquals(ITaskSession.Status.FINISHED,taskSession.getStatus());
			assertNotNull(persisted.getStartTimestamp());
			assertNotNull(persisted.getFinishTimestamp());
			assertEquals(ITestTask.PROGRESS, persisted.getProgress(), 0);
			assertEquals(ITestTask.PROGRESS_CURRENT,persisted.getCurrentProgress(), 0);
			assertEquals(ITestTask.PROGRESS_FINAL,persisted.getFinalProgress(), 0);
			assertEquals(false, persisted.isStopable());
			assertEquals(false, persisted.isDeleteOnFinish());
			assertNull(persisted.getErrorType());
			assertNull(persisted.getError());
		} finally
		{
			ITestTask.close(db);
		}
		OrientDbWebSession.get().signOut();
	}

	@Test
	@Ignore
	public void consoleTaskTest() throws Exception{
		assertTrue(OrientDbWebSession.get().signIn("admin", "admin"));
		ODatabaseSession db = OrientDbWebSession.get().getDatabaseSession();
		assertFalse(db.isClosed());
		db.commit();
		try
		{
			IOConsoleTask task = DAO.create(IOConsoleTask.class);
			task.setAutodeleteSessions(false);
			task.setInput(CONSOLE_TEST_COMMAND);
			task.save();

			IOConsoleTask taskAD = DAO.create(IOConsoleTask.class);
			task.setAutodeleteSessions(true);
			task.setInput(CONSOLE_TEST_COMMAND);
			task.save();

			OTaskSessionRuntime<IOTaskSessionPersisted> taskSession = task.startNewSession();
			Thread.sleep(CONSOLE_TASK_DELAY);
			db.commit();
			IOTaskSessionPersisted persisted = taskSession.getOTaskSessionPersisted();
			assertNull(persisted.getError());
			assertNotNull(persisted.getFinishTimestamp());
			assertEquals(12.0, persisted.getCurrentProgress(), 0);
			assertEquals(ITaskSession.Status.INTERRUPTED,taskSession.getStatus());
		} finally
		{
			OrientDbWebSession.get().signOut();
		}
	}

}


text:
<!DOCTYPE html>
<html>

    <head>
        <meta charset="UTF-8">
        <!-- 让国内基于webkit的浏览器默认采用webkit内核进行渲染 -->
        <meta name="renderer" content="webkit" />
        <!-- 移动端的响应式特性 -->
        <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
        <title>leetcodeJS大法之Elimination-Game</title>
        <link rel="stylesheet" href="../../css/common/reset.css" />
    </head>

    <body>
        <script type="text/javascript" src="Elimination-Game.js"></script>
        <script>
            var lastRemaining = LeetCode.lastRemaining;

            console.log(lastRemaining(9));

        </script>
    </body>

</html>


text:
#ifndef _VKTSPVASMCOMPUTESHADERCASE_HPP
#define _VKTSPVASMCOMPUTESHADERCASE_HPP
/*!
 * \file
 * \brief Test Case Skeleton Based on Compute Shaders
 *//*--------------------------------------------------------------------*/

#include "vkPrograms.hpp"
#include "vktTestCase.hpp"

#include "vktSpvAsmComputeShaderTestUtil.hpp"

namespace vkt
{
namespace SpirVAssembly
{
/*--------------------------------------------------------------------*//*!
 * \brief Test instance for compute pipeline
 *
 * The compute shader is specified in the format of SPIR-V assembly, which
 * is allowed to access MAX_NUM_INPUT_BUFFERS input storage buffers and
 * MAX_NUM_OUTPUT_BUFFERS output storage buffers maximally. The shader
 * source and input/output data are given in a ComputeShaderSpec object.
 *
 * This instance runs the given compute shader by feeding the data from input
 * buffers and compares the data in the output buffers with the expected.
 *//*--------------------------------------------------------------------*/
class SpvAsmComputeShaderInstance : public TestInstance
{
public:
										SpvAsmComputeShaderInstance	(Context& ctx, const ComputeShaderSpec& spec);
	tcu::TestStatus						iterate						(void);

private:
	const ComputeShaderSpec&			m_shaderSpec;
};

class SpvAsmComputeShaderCase : public TestCase
{
public:
						SpvAsmComputeShaderCase	(tcu::TestContext& testCtx, const char* name, const char* description, const ComputeShaderSpec& spec);
	void				initPrograms			(vk::SourceCollections& programCollection) const;
	TestInstance*		createInstance			(Context& ctx) const;

private:
	ComputeShaderSpec	m_shaderSpec;
};

} // SpirVAssembly
} // vkt

#endif // _VKTSPVASMCOMPUTESHADERCASE_HPP


text:
var StoreAccessmanage = "";
$(function () {
    var aspxCommonObj = {
        StoreID: AspxCommerce.utils.GetStoreID(),
        PortalID: AspxCommerce.utils.GetPortalID(),
        UserName: AspxCommerce.utils.GetUserName(),
        CultureName: AspxCommerce.utils.GetCultureName()
    };
    var Edit = 0;
    var isActive = false;
    var StoreAccessKeyID = 0;
    var StoreAccessData = '';
    var isIP = false;
    var auto = false;
    var storeAccessVar = '';
    var dletemsgonce = false;
    var validIp = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/;
    $.validator.addMethod('IP4Checker', function (value) {
        var ipAddress = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/;
        return value.match(ipAddress);
    }, getLocale(AspxStoreAccessManagement, 'Invalid IP address'));

    $.validator.addMethod('IP4CheckerTo', function (value) {
        var ipAddress = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/;
        if (value == "") {
            return true;
        }
        return value.match(ipAddress);
    }, getLocale(AspxStoreAccessManagement, 'Invalid IP address'));
    $.validator.addMethod('EmailChecker', function (value) {
        var email_regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
        return value.match(email_regex);
    }, getLocale(AspxStoreAccessManagement, 'Invalid Email'));

    $.validator.addMethod('CardChecker', function (value) {
        var creditCardRegex = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/;

        return value.match(creditCardRegex);
    }, getLocale(AspxStoreAccessManagement, 'Invalid CreditCard'));
    $.validator.addMethod('DomainChecker', function (value) {
        var urlRegex = /[^w{3}\.]([a-zA-Z0-9]([a-zA-Z0-9\-]{0,65}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}/igm;
        return value.match(urlRegex);
    }, getLocale(AspxStoreAccessManagement, 'Invalid Domain'));

    StoreAccessmanage = {
        config: {
            isPostBack: false,
            async: false,
            cache: false,
            type: 'POST',
            contentType: "application/json; charset=utf-8",
            data: '{}',
            dataType: 'json',
            baseURL: aspxservicePath + "AspxCoreHandler.ashx/",
            method: "",
            url: ""
        },

        init: function () {
            var v = $("#form1").validate({
                messages: {
                    txtNameValidate: {
                        required: '*'
                    },
                    msg: {
                        required: '*'
                    },
                    status: {
                        required: '*'
                    }
                },
                rules: {
                    ipAddress1: {
                        required: true,
                        IP4Checker: true
                    },
                    ipAddress: {
                        IP4CheckerTo: true
                    },
                    Email2: {
                        EmailChecker: true
                    },
                    Credit: {
                        required: true,
                        CardChecker: true
                    },
                    website: {
                        required: true,
                        DomainChecker: true
                    }
                }
            });

            var $tabs = $('#dvTabPanel').tabs({ fx: [null, { height: 'show', opacity: 'show' }] });
            $tabs.tabs('option', 'active', 0);
            StoreAccessmanage.SelectFirstTab();
            StoreAccessmanage.LoadStoreAccessMgmtStaticImage();
            StoreAccessmanage.bindAll();
            $("#txtsrchIPDate,#txtIPEndDate,#txtsrchDomainDate,#txtDomainEndDate,#txtsrchEmailDate,#txtEmailEndDate,#txtsrchCreditCardDate,#txtCardEndDate,#txtsrchCustomerDate,#txtCustomerDate").datepicker({ dateFormat: 'yy/mm/dd' });

            $(".cssClassClose").click(function () {
                RemovePopUp();
                StoreAccessmanage.ClearEditAddForm();
                $('#IPTO').remove();
                auto = false;
                Edit = 0;
                v.resetForm();
                StoreAccessmanage.ClearPopUpError();
            });

            $("#btnCancelSaveUpdate").click(function () {
                RemovePopUp();
                StoreAccessmanage.ClearEditAddForm();
                $('#IPTO').remove();
                auto = false;
                Edit = 0;
                v.resetForm();
                StoreAccessmanage.ClearPopUpError();

            });
            $('#txtsrchIP,#txtsrchIPDate,#txtIPEndDate,#SelectStatusIP').keyup(function (event) {
                if (event.keyCode == 13) {
                    StoreAccessmanage.searchStoreAccess('#btnSrchIP');
                }
            });
            $('#txtsrchDomain,#txtsrchDomainDate,#txtDomainEndDate,#SelectStatusDomain').keyup(function (event) {
                if (event.keyCode == 13) {
                    StoreAccessmanage.searchStoreAccess('#btnSrchDomain');
                }
            });
            $('#txtsrchEmail,#txtsrchEmailDate,#txtEmailEndDate,#SelectStatusEmail').keyup(function (event) {
                if (event.keyCode == 13) {
                    StoreAccessmanage.searchStoreAccess('#btnSrchEmail');
                }
            });
            $('#txtsrchCreditCard,#txtsrchCreditCardDate,#txtCardEndDate,#SelectStatusCreditCard').keyup(function (event) {
                if (event.keyCode == 13) {
                    StoreAccessmanage.searchStoreAccess('#btnSrchCreditCard');
                }
            });
            $('#txtsrchCustomer,#txtsrchCustomerDate,#txtCustomerDate,#SelectStatusCustomer').keyup(function (event) {
                if (event.keyCode == 13) {
                    StoreAccessmanage.searchStoreAccess('#btnSrchCustomer');
                }
            });

            $('#btnDeleteSelectedIP,#btnDeleteSelectedDomain,#btnDeleteSelectedEmail,#btnDeleteSelectedCreditCard,#btnDeleteSelectedCustomer').click(function () {
                dletemsgonce = false;
                var attribute_ids = new Array;
                attribute_ids = [];
                switch ($(this).prop('id')) {
                    case "btnDeleteSelectedIP":
                        attribute_ids = SageData.Get("gdvIP").Arr;
                        if (attribute_ids.length > 0) {
                            var properties = {
                                onComplete: function (e) {
                                    StoreAccessmanage.ConfirmDeleteMultiple(attribute_ids, e);
                                }
                            };
                            csscody.confirm("
" + getLocale(AspxStoreAccessManagement, "Delete Confirmation") + "

" + getLocale(AspxStoreAccessManagement, "Are you sure you want to delete the selected IP?") + "
", properties);
                        } else {
                            csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + '

' + getLocale(AspxStoreAccessManagement, "Please select at least one IP before delete.") + '
');
                        }
                        break;
                    case "btnDeleteSelectedDomain":
                        attribute_ids = SageData.Get("gdvDomain").Arr;
                        if (attribute_ids.length > 0) {
                            var properties = {
                                onComplete: function (e) {
                                    StoreAccessmanage.ConfirmDeleteMultiple(attribute_ids, e);
                                }
                            };
                            csscody.confirm("
" + getLocale(AspxStoreAccessManagement, "Delete Confirmation") + "

" + getLocale(AspxStoreAccessManagement, "Are you sure you want to delete the selected domain?") + "
", properties);
                        } else {
                            csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "Please select at least one domain before delete.") + '
');
                        }
                        break;
                    case "btnDeleteSelectedEmail":
                        attribute_ids = SageData.Get("gdvEmail").Arr;
                        if (attribute_ids.length > 0) {
                            var properties = {
                                onComplete: function (e) {
                                    StoreAccessmanage.ConfirmDeleteMultiple(attribute_ids, e);
                                }
                            };
                            csscody.confirm("
Delete Confirmation

Are you sure you want to delete the selected email?
", properties);
                        } else {
                            csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "Please select at least one email before delete.") + '
');
                        }
                        break;
                    case "btnDeleteSelectedCreditCard":
                        attribute_ids = SageData.Get("gdvCreditCard").Arr;
                        if (attribute_ids.length > 0) {
                            var properties = {
                                onComplete: function (e) {
                                    StoreAccessmanage.ConfirmDeleteMultiple(attribute_ids, e);
                                }
                            };
                            csscody.confirm("
" + getLocale(AspxStoreAccessManagement, "Delete Confirmation") + "

" + getLocale(AspxStoreAccessManagement, "Are you sure you want to delete the selected credit card?") + "
", properties);
                        } else {
                            csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + '

' + getLocale(AspxStoreAccessManagement, "Please select at least one credit card before delete.") + '
');
                        }
                        break;
                    case "btnDeleteSelectedCustomer":
                        attribute_ids = SageData.Get("gdvCustomer").Arr;
                        if (attribute_ids.length > 0) {
                            var properties = {
                                onComplete: function (e) {
                                    StoreAccessmanage.ConfirmDeleteMultiple(attribute_ids, e);
                                }
                            };
                            csscody.confirm("
" + getLocale(AspxStoreAccessManagement, "Delete Confirmation") + "

" + getLocale(AspxStoreAccessManagement, "Are you sure you want to delete the selected customer?") + "
", properties);
                        } else {
                            csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + '

' + getLocale(AspxStoreAccessManagement, "Please select at least one customer before delete.") + '
');
                        }
                        break;
                    default:
                        break;
                }
            });
            $("#txtStoreAccessValue").bind("focusout", function () {
                switch (StoreAccessKeyID) {
                    case "3":
                        StoreAccessmanage.CheckEmail();
                        break;
                }
            });

            $('#btnAddIP,#btnAddDomain,#btnAddEmail,#btnAddCustomer,#btnAddCreditCard').click(function () {
                StoreAccessmanage.ClearPopUpError();
                $('#txtStoreAccessValue').removeAttr("name");
                $('#IPTO').remove();
                Edit = 0;
                var btn = $(this).prop('id');
                switch (btn) {
                    case "btnAddIP":
                        isIP = true;
                        $('#txtStoreAccessValue').prop("name", "ipAddress1");
                        storeAccessVar = "IP address";
                        StoreAccessKeyID = $('input[name="IP"]').val();
                        $('
<asp:Label ID="lblIpRangeTo" Text="To:" runat="server" CssClass="cssClassLabel">' + getLocale(AspxStoreAccessManagement, "To:") + '</asp:Label> 	<input type="text" id="txtStoreAccessValueTo" class="sfInputbox"  name="ipAddress" />
').insertAfter('#forIPonly');
                        $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Add new IP Range:"));
                        $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Add new IP Range:"));
                        StoreAccessmanage.ClearEditAddForm();
                        $('#chkStatusActive').prop('checked', true);
                        ShowPopupControl("popuprel");
                        break;
                    case "btnAddDomain":
                        isIP = false;
                        $('#txtStoreAccessValue').prop("name", "website");
                        storeAccessVar = "Domain";
                        StoreAccessKeyID = $('input[ name="Domain"]').val();
                        $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Add new Domain:"));
                        $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Add new Domain:"));
                        StoreAccessmanage.ClearEditAddForm();
                        $('#chkStatusActive').prop('checked', true);
                        ShowPopupControl("popuprel");
                        break;
                    case "btnAddEmail":
                        isIP = false;
                        $('#txtStoreAccessValue').prop("name", "Email2");
                        storeAccessVar = "Email";
                        StoreAccessKeyID = $('input[ name="Email"]').val();
                        $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Add new Email:"));
                        $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Add new Email:"));
                        StoreAccessmanage.ClearEditAddForm();
                        $('#chkStatusActive').prop('checked', true);
                        ShowPopupControl("popuprel"); $('#txtStoreAccessValue').autocomplete({
                            open: function () {
                                setTimeout(function () {
                                    $('.ui-autocomplete').css('z-index', 9999);
                                }, 0);
                            },
                            source: function (req, res) {
                                $.ajax({
                                    url: aspxservicePath + "AspxCoreHandler.ashx/GetAspxUserEmail", beforeSend: function (request) {
                                        request.setRequestHeader('ASPX-TOKEN', _aspx_token);
                                        request.setRequestHeader("UMID", umi);
                                        request.setRequestHeader("UName", AspxCommerce.utils.GetUserName());
                                        request.setRequestHeader("PID", AspxCommerce.utils.GetPortalID());
                                        request.setRequestHeader("PType", "v");
                                        request.setRequestHeader('Escape', '0');
                                    },
                                    data: JSON2.stringify({ email: $('#txtStoreAccessValue').val(), aspxCommonObj: aspxCommonObj }),
                                    dataType: "json",
                                    type: "POST",
                                    contentType: "application/json; charset=utf-8",
                                    dataFilter: function (da) { return da; },
                                    success: function (da) {

                                        res($.map(da.d, function (item) {
                                            return {
                                                value: item.Email
                                            };
                                        }));

                                    },
                                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                                        alert(textStatus);
                                    }
                                });
                            },
                            minLength: 1
                        });
                        $('#txtStoreAccessValue').autocomplete("enable");
                        break;
                    case "btnAddCreditCard":
                        isIP = false;
                        storeAccessVar = "Credit Card";
                        $('#txtStoreAccessValue').prop("name", "Credit");
                        StoreAccessKeyID = $('input[ name="CreditCard"]').val();
                        $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Add new Credit Card:"));
                        $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Add new Credit Card:"));
                        StoreAccessmanage.ClearEditAddForm();
                        $('#chkStatusActive').prop('checked', true);
                        ShowPopupControl("popuprel");
                        break;
                    case "btnAddCustomer":
                        isIP = false;
                        auto = true;
                        storeAccessVar = "Customer";
                        StoreAccessKeyID = $('input[ name="Customer"]').val();
                        $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Add new Customer:"));
                        $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Add new Customer:"));
                        StoreAccessmanage.ClearEditAddForm();
                        $('#chkStatusActive').prop('checked', true);
                        ShowPopupControl("popuprel");
                        $('#txtStoreAccessValue').autocomplete({
                            open: function () {
                                setTimeout(function () {
                                    $('.ui-autocomplete').css('z-index', 9999);
                                }, 0);
                            },
                            source: function (request, response) {
                                $.ajax({
                                    url: aspxservicePath + "AspxCoreHandler.ashx/GetAspxUser", beforeSend: function (request) {
                                        request.setRequestHeader('ASPX-TOKEN', _aspx_token);
                                        request.setRequestHeader("UMID", umi);
                                        request.setRequestHeader("UName", AspxCommerce.utils.GetUserName());
                                        request.setRequestHeader("PID", AspxCommerce.utils.GetPortalID());
                                        request.setRequestHeader("PType", "v");
                                        request.setRequestHeader('Escape', '0');
                                    },
                                    data: JSON2.stringify({ userName: $('#txtStoreAccessValue').val(), aspxCommonObj: aspxCommonObj }),
                                    dataType: "json",
                                    type: "POST",
                                    contentType: "application/json; charset=utf-8",
                                    dataFilter: function (data) { return data; },
                                    success: function (data) {
                                        if (auto) {
                                            response($.map(data.d, function (item) {
                                                return {
                                                    value: item.UserName
                                                };
                                            }));
                                        }
                                    },
                                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                                        alert(textStatus);
                                    }
                                });
                            },
                            minLength: 2
                        });
                        $('#txtStoreAccessValue').autocomplete("enable");

                        break;
                    default:
                        break;
                }
            });

            $('#btnSubmit').click(function () {
                if (v.form()) {
                    RemovePopUp();
                    StoreAccessmanage.SaveUpdate();
                    StoreAccessmanage.ClearEditAddForm();
                    $('#IPTO').remove();
                    auto = false;
                } else {
                    return false;
                }

            });
        },
        ajaxCall: function (config) {
            $.ajax({
                type: StoreAccessmanage.config.type, beforeSend: function (request) {
                    request.setRequestHeader('ASPX-TOKEN', _aspx_token);
                    request.setRequestHeader("UMID", umi);
                    request.setRequestHeader("UName", AspxCommerce.utils.GetUserName());
                    request.setRequestHeader("PID", AspxCommerce.utils.GetPortalID());
                    request.setRequestHeader("PType", "v");
                    request.setRequestHeader('Escape', '0');
                },
                contentType: StoreAccessmanage.config.contentType,
                cache: StoreAccessmanage.config.cache,
                async: StoreAccessmanage.config.async,
                url: StoreAccessmanage.config.url,
                data: StoreAccessmanage.config.data,
                dataType: StoreAccessmanage.config.dataType,
                success: StoreAccessmanage.ajaxSuccess,
                error: StoreAccessmanage.ajaxFailure
            });
        },

        ClearPopUpError: function () {
            $('#txtStoreAccessValue').removeClass('error');
            $('#txtStoreAccessValue').parents('td').find('label').remove();
            $('#txtReason').removeClass('error');
            $('#txtReason').parents('td').find('label').remove();
        },

        ConfirmDeleteMultiple: function (attribute_ids, event) {
            if (event) {
                for (var id in attribute_ids) {
                    StoreAccessmanage.DeleteStoreAccessByID(attribute_ids[id], event);
                }
                attribute_ids = [];
                // StoreAccessmanage.bindAll();
            }
        },

        LoadStoreAccessMgmtStaticImage: function () {
            $('#ajaxStoreAccessImage1').prop('src', '' + aspxTemplateFolderPath + '/images/ajax-loader.gif');
            $('#ajaxStoreAccessImage2').prop('src', '' + aspxTemplateFolderPath + '/images/ajax-loader.gif');
            $('#ajaxStoreAccessImage3').prop('src', '' + aspxTemplateFolderPath + '/images/ajax-loader.gif');
            $('#ajaxStoreAccessImage4').prop('src', '' + aspxTemplateFolderPath + '/images/ajax-loader.gif');
            $('#ajaxStoreAccessImage5').prop('src', '' + aspxTemplateFolderPath + '/images/ajax-loader.gif');
        },

        SelectFirstTab: function () {
            var $tabs = $('#dvMultipleAddress').tabs({ fx: [null, { height: 'show', opacity: 'show' }] });
            $tabs.tabs('option', 'active', 0);
        },

        bindAll: function () {
            StoreAccessmanage.LoadStoreAccessIPs(null, null, null, null);
            StoreAccessmanage.LoadStoreAccessDomains(null, null, null, null);
            StoreAccessmanage.LoadStoreAccessEmails(null, null, null, null);
            StoreAccessmanage.LoadStoreAccessCreditCards(null, null, null, null);
            StoreAccessmanage.LoadStoreAccessCustomers(null, null, null, null);
            StoreAccessmanage.loadkey();
        },

        ClearEditAddForm: function () {
            $('#txtStoreAccessValue').val('');
            $('#txtReason').val('');
            $('#editAdd input[type="radio"]').prop('checked', false);
        },
        CheckEmail: function () {
            switch (StoreAccessKeyID) {
                case "3":
                    var isAdmin = false;
                    var email = $.trim($('#txtStoreAccessValue').val());
                    $.ajax({
                        url: aspxservicePath + "AspxCoreHandler.ashx/CheckEmailAddress", beforeSend: function (request) {
                            request.setRequestHeader('ASPX-TOKEN', _aspx_token);
                            request.setRequestHeader("UMID", umi);
                            request.setRequestHeader("UName", AspxCommerce.utils.GetUserName());
                            request.setRequestHeader("PID", AspxCommerce.utils.GetPortalID());
                            request.setRequestHeader("PType", "v");
                            request.setRequestHeader('Escape', '0');
                        },
                        data: JSON2.stringify({ email: email, aspxCommonObj: aspxCommonObj }),
                        dataType: "json",
                        type: "POST",
                        async: false,
                        contentType: "application/json; charset=utf-8",
                        success: function (data) {
                            isAdmin = data.d;
                        },
                        error: function () {
                        }
                    });
                    if (isAdmin) {
                        csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "You are not allowed to add admin email address") + '
');
                        $("#txtStoreAccessValue").val('');
                        return false;
                    }

                    break;
            }

        },

        SaveUpdate: function (e) {
            if (isIP) {

                if ($.trim($('#txtStoreAccessValueTo').val()) == "") {
                    StoreAccessData = $('#txtStoreAccessValue').val();
                    if (validIp.test(StoreAccessData)) {
                    } else {
                        csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "Invalid Ip Address [From]") + '
');
                        return false;
                    }
                } else {
                    StoreAccessData = $('#txtStoreAccessValue').val() + '-' + $('#txtStoreAccessValueTo').val();
                    if (validIp.test($('#txtStoreAccessValue').val())) {
                        if (validIp.test($('#txtStoreAccessValueTo').val())) {
                            if ($('#txtStoreAccessValue').val() > $('#txtStoreAccessValueTo').val()) {
                                csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "Invalid Ip Range") + '
');
                                return false;
                            } else {

                            }
                        } else {
                            $('#txtStoreAccessValueTo').addClass("required error");
                        }
                    } else {
                        csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "Invalid Ip Address [From]") + '
');
                        return false;
                    }
                }

            } else {
                StoreAccessData = $('#txtStoreAccessValue').val();
            }

            if ($('#chkStatusActive').prop('checked')) {
                isActive = true;
            } else {
                isActive = false;
            }
            switch (StoreAccessKeyID) {
                case "5":
                    if ($.trim($('#txtStoreAccessValue').val().toLowerCase()) == 'superuser') {
                        csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + '

' + getLocale(AspxStoreAccessManagement, "You are not allowed to add superuser") + '
');
                        return false;
                    }

                    break;
                case "3":
                    StoreAccessmanage.CheckEmail();
                    break;
            }

            var storeData = isIP == false ? $.trim($("#txtStoreAccessValue").val()) : ($.trim($("#txtStoreAccessValue").val()) + '-' + $.trim($("#txtStoreAccessValueTo").val()));
            if (Edit > 0) {
                StoreAccessmanage.config.url = StoreAccessmanage.config.baseURL + "SaveUpdateStoreAccess";
                StoreAccessmanage.config.data = JSON2.stringify({ edit: Edit, storeAccessKeyID: StoreAccessKeyID, storeAccessData: StoreAccessData, reason: $('#txtReason').val(), isActive: isActive, aspxCommonObj: aspxCommonObj });
                StoreAccessmanage.config.ajaxCallMode = 1;
                StoreAccessmanage.ajaxCall(StoreAccessmanage.config);
            }
            else {
                $.ajax({
                    url: this.config.baseURL + "CheckExisting", beforeSend: function (request) {
                        request.setRequestHeader('ASPX-TOKEN', _aspx_token);
                        request.setRequestHeader("UMID", umi);
                        request.setRequestHeader("UName", AspxCommerce.utils.GetUserName());
                        request.setRequestHeader("PID", AspxCommerce.utils.GetPortalID());
                        request.setRequestHeader("PType", "v");
                        request.setRequestHeader('Escape', '0');
                    },
                    data: JSON2.stringify({ aspxCommonObj: aspxCommonObj, storeAccesskeyId: StoreAccessKeyID, accessData: storeData }),
                    dataType: "json",
                    type: "POST",
                    async: false,
                    contentType: "application/json; charset=utf-8",
                    success: function (data) {
                        if (data.d == 'true' || data.d == true) {
                            StoreAccessmanage.config.url = StoreAccessmanage.config.baseURL + "SaveUpdateStoreAccess";
                            StoreAccessmanage.config.data = JSON2.stringify({ edit: Edit, storeAccessKeyID: StoreAccessKeyID, storeAccessData: StoreAccessData, reason: $('#txtReason').val(), isActive: isActive, aspxCommonObj: aspxCommonObj });
                            StoreAccessmanage.config.ajaxCallMode = 1;
                            StoreAccessmanage.ajaxCall(StoreAccessmanage.config);
                        } else {
                            csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Alert Message") + '

' + getLocale(AspxStoreAccessManagement, "Inputed Data is Already Exist!.") + '
');
                        }
                    },
                    error: function () {
                    }
                });
            }

        },

        loadkey: function () {
            this.config.url = this.config.baseURL + "GetStoreKeyID";
            this.config.data = '{}';
            this.config.ajaxCallMode = 2;
            this.ajaxCall(this.config);
        },
        CheckExisting: function () {
            this.config.url = this.config.baseURL + "CheckExisting";
            this.config.data = JSON2.stringify({ aspxCommonObj: aspxCommonObj, storeAccesskeyId: StoreAccessKeyID, accessData: storeData })
            this.config.ajaxCallMode = 4;
            this.ajaxCall(this.config);
        },

        searchStoreAccess: function (Id) {
            switch ($(Id).prop('id')) {
                case "btnSrchIP":
                    var Search = $.trim($('#txtsrchIP').val());
                    var startDate = $('#txtsrchIPDate').val();
                    var endDate = $("#txtIPEndDate").val();
                    var Status = $.trim($('#SelectStatusIP').val()) == "" ? null : ($.trim($('#SelectStatusIP').val()) == "True" ? true : false);
                    if (Search.length < 1) {
                        Search = null;
                    }

                    if (startDate.length < 1) {
                        startDate = null;
                    }
                    if (endDate.length < 1) {
                        endDate = null;
                    }
                    if ((startDate <= endDate) || (startDate == null && endDate != '') || (startDate != "" && endDate == null)) {
                        var ipAddress = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/;
                        if (Search != null && Search != "") {
                            if (Search.match(ipAddress)) {
                                StoreAccessmanage.LoadStoreAccessIPs(Search, startDate, endDate, Status);
                            } else {
                                csscody.alert('
' + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "Please enter valid ip address!") + '
');
                            }
                        } else {
                            StoreAccessmanage.LoadStoreAccessIPs(Search, startDate, endDate, Status);
                        }

                    } else {
                        csscody.alert("
" + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "From date must be less than To date!") + "
");
                    }
                    break;
                case "btnSrchDomain":
                    var Search = $.trim($('#txtsrchDomain').val());
                    var startDate = $.trim($('#txtsrchDomainDate').val());
                    var endDate = $("#txtDomainEndDate").val();
                    var Status = $.trim($('#SelectStatusDomain').val()) == "" ? null : ($.trim($('#SelectStatusDomain').val()) == "True" ? true : false);

                    if (Search.length < 1) {
                        Search = null;
                    }
                    if (startDate.length < 1) {
                        startDate = null;
                    }
                    if (endDate.length < 1) {
                        endDate = null;
                    }
                    if ((startDate <= endDate) || (startDate == null && endDate != '') || (startDate != "" && endDate == null)) {
                        StoreAccessmanage.LoadStoreAccessDomains(Search, startDate, endDate, Status);
                    } else {
                        csscody.alert("
" + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "From date must be less than To date!") + "
");
                    }
                    break;
                case "btnSrchEmail":
                    var Search = $.trim($('#txtsrchEmail').val());
                    var startDate = $.trim($('#txtsrchEmailDate').val());
                    var endDate = $("#txtEmailEndDate").val();
                    var Status = $.trim($('#SelectStatusEmail').val()) == "" ? null : ($.trim($('#SelectStatusEmail').val()) == "True" ? true : false);

                    if (Search.length < 1) {
                        Search = null;
                    }
                    if (startDate.length < 1) {
                        startDate = null;
                    }
                    if (endDate.length < 1) {
                        endDate = null;
                    }
                    if ((startDate <= endDate) || (startDate == null && endDate != '') || (startDate != "" && endDate == null)) {
                        StoreAccessmanage.LoadStoreAccessEmails(Search, startDate, endDate, Status);
                    } else {
                        csscody.alert("
" + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "From date must be less than To date!") + "
");
                    }
                    break;
                case "btnSrchCreditCard":
                    var Search = $.trim($('#txtsrchCreditCard').val());
                    var startDate = $.trim($('#txtsrchCreditCardDate').val());
                    var endDate = $("#txtCardEndDate").val();
                    var Status = $.trim($('#SelectStatusCreditCard').val()) == "" ? null : ($.trim($('#SelectStatusCreditCard').val()) == "True" ? true : false);

                    if (Search.length < 1) {
                        Search = null;
                    }
                    if (startDate.length < 1) {
                        startDate = null;
                    }
                    if (endDate.length < 1) {
                        endDate = null;
                    }
                    if ((startDate <= endDate) || (startDate == null && endDate != '') || (startDate != "" && endDate == null)) {
                        StoreAccessmanage.LoadStoreAccessCreditCards(Search, startDate, endDate, Status);
                    } else {
                        csscody.alert("
" + getLocale(AspxStoreAccessManagement, "Information Alert") + "

" + getLocale(AspxStoreAccessManagement, "From date must be less than To date!") + "
");
                    }
                    break;
                case "btnSrchCustomer":
                    var Search = $.trim($('#txtsrchCustomer').val());
                    var startDate = $.trim($('#txtsrchCustomerDate').val());
                    var endDate = $("#txtCustomerDate").val();
                    var Status = $.trim($('#SelectStatusCustomer').val()) == "" ? null : ($.trim($('#SelectStatusCustomer').val()) == "True" ? true : false);

                    if (Search.length < 1) {
                        Search = null;
                    }
                    if (startDate.length < 1) {
                        startDate = null;
                    }
                    if (endDate.length < 1) {
                        endDate = null;
                    }
                    if ((startDate <= endDate) || (startDate == null && endDate != '') || (startDate != "" && endDate == null)) {
                        StoreAccessmanage.LoadStoreAccessCustomers(Search, startDate, endDate, Status);
                    } else {
                        csscody.alert("
" + historyLocale(AspxStoreAccessManagement, " Alert") + "

" + getLocale(AspxStoreAccessManagement, "From date must be less than To date!") + "
");
                    }
                    break;
                default:
                    break;
            }
        },

        LoadStoreAccessIPs: function (search, startdate, enddate, status) {
            this.config.method = "LoadStoreAccessIPs";
            var offset_ = 1;
            var current_ = 1;
            var perpage = ($("gdvIP_pagesize").length > 0) ? $("#gdvIP_pagesize :selected").text() : 10;

            $("#gdvIP").sagegrid({
                url: this.config.baseURL,
                functionMethod: this.config.method,
                colModel: [
                    { display: getLocale(AspxStoreAccessManagement, 'Ids'), name: 'Ids', cssclass: 'cssClassHeadCheckBox', coltype: 'checkbox', align: 'center', elemClass: 'attrChkbox', elemDefault: false, controlclass: 'itemsHeaderChkbox' },
                    { display: getLocale(AspxStoreAccessManagement, 'IP'), name: 'IPRange', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Reason'), name: 'Reason', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Added On'), name: 'Added On', cssclass: 'cssClassHeadDate', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Status'), name: 'Status', cssclass: 'cssClassHeadBoolean', controlclass: '', coltype: 'label', align: 'left', type: 'boolean', format: 'Active/Inactive' },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyType'), name: 'KeyType', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyID'), name: 'KeyID', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'Actions'), name: 'action', cssclass: 'cssClassAction', coltype: 'label', align: 'center' }
                ],
                buttons: [
                    { display: getLocale(AspxStoreAccessManagement, 'Edit'), name: 'edit', enable: true, _event: 'click', trigger: '1', callMethod: 'StoreAccessmanage.EditCoupons', arguments: '1,2,3,4,5,6,7' },
                    { display: getLocale(AspxStoreAccessManagement, 'Delete'), name: 'delete', enable: true, _event: 'click', trigger: '2', callMethod: 'StoreAccessmanage.DeleteCoupons', arguments: '1' }
                ],

                rp: perpage,
                nomsg: getLocale(AspxStoreAccessManagement, "No Records Found!"),
                param: { search: search, startDate: startdate, endDate: enddate, status: status, aspxCommonObj: aspxCommonObj },
                current: current_,
                pnew: offset_,
                sortcol: { 0: { sorter: false }, 7: { sorter: false } }
            });
        },

        LoadStoreAccessDomains: function (search, startdate, enddate, status) {
            this.config.method = "LoadStoreAccessDomains";
            var offset_ = 1;
            var current_ = 1;
            var perpage = ($("gdvDomain_pagesize").length > 0) ? $("#gdvDomain_pagesize :selected").text() : 10;

            $("#gdvDomain").sagegrid({
                url: this.config.baseURL,
                functionMethod: this.config.method,
                colModel: [
                    { display: getLocale(AspxStoreAccessManagement, 'Ids'), name: 'Ids', cssclass: 'cssClassHeadCheckBox', coltype: 'checkbox', align: 'center', elemClass: 'attrChkbox', elemDefault: false, controlclass: 'itemsHeaderChkbox' },
                    { display: getLocale(AspxStoreAccessManagement, 'Domain'), name: 'Domain', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Reason'), name: 'Reason', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Added On'), name: 'Added On', cssclass: 'cssClassHeadDate', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Status'), name: 'Status', cssclass: 'cssClassHeadBoolean', controlclass: '', coltype: 'label', align: 'left', type: 'boolean', format: 'Active/Inactive' },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyType'), name: 'KeyType', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyID'), name: 'KeyID', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'Actions'), name: 'action', cssclass: 'cssClassAction', coltype: 'label', align: 'center' }
                ],
                buttons: [
                    { display: getLocale(AspxStoreAccessManagement, 'Edit'), name: 'edit', enable: true, _event: 'click', trigger: '1', callMethod: 'StoreAccessmanage.EditCoupons', arguments: '1,2,3,4,5,6,7' },
                    { display: getLocale(AspxStoreAccessManagement, 'Delete'), name: 'delete', enable: true, _event: 'click', trigger: '2', callMethod: 'StoreAccessmanage.DeleteCoupons', arguments: '1' }
                ],
                rp: perpage,
                nomsg: getLocale(AspxStoreAccessManagement, "No Records Found!"),
                param: { search: search, startDate: startdate, endDate: enddate, status: status, aspxCommonObj: aspxCommonObj },
                current: current_,
                pnew: offset_,
                sortcol: { 0: { sorter: false }, 7: { sorter: false } }
            });
        },

        LoadStoreAccessEmails: function (search, startdate, enddate, status) {
            this.config.method = "LoadStoreAccessEmails";
            var offset_ = 1;
            var current_ = 1;
            var perpage = ($("gdvEmail_pagesize").length > 0) ? $("#gdvEmail_pagesize :selected").text() : 10;

            $("#gdvEmail").sagegrid({
                url: this.config.baseURL,
                functionMethod: this.config.method,
                colModel: [
                    { display: getLocale(AspxStoreAccessManagement, 'Ids'), name: 'Ids', cssclass: 'cssClassHeadCheckBox', coltype: 'checkbox', align: 'center', elemClass: 'attrChkbox', elemDefault: false, controlclass: 'itemsHeaderChkbox' },
                    { display: getLocale(AspxStoreAccessManagement, 'Email'), name: 'Email', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Reason'), name: 'Reason', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Added On'), name: 'Added On', cssclass: 'cssClassHeadDate', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Status'), name: 'Status', cssclass: 'cssClassHeadBoolean', controlclass: '', coltype: 'label', align: 'left', type: 'boolean', format: 'Active/Inactive' },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyType'), name: 'KeyType', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyID'), name: 'KeyID', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'Actions'), name: 'action', cssclass: 'cssClassAction', coltype: 'label', align: 'center' }
                ],
                buttons: [
                    { display: getLocale(AspxStoreAccessManagement, 'Edit'), name: 'edit', enable: true, _event: 'click', trigger: '1', callMethod: 'StoreAccessmanage.EditCoupons', arguments: '1,2,3,4,5,6,7' },
                    { display: getLocale(AspxStoreAccessManagement, 'Delete'), name: 'delete', enable: true, _event: 'click', trigger: '2', callMethod: 'StoreAccessmanage.DeleteCoupons', arguments: '' }
                ],

                rp: perpage,
                nomsg: getLocale(AspxStoreAccessManagement, "No Records Found!"),
                param: { search: search, startDate: startdate, endDate: enddate, status: status, aspxCommonObj: aspxCommonObj },
                current: current_,
                pnew: offset_,
                sortcol: { 0: { sorter: false }, 7: { sorter: false } }
            });
        },

        EditCoupons: function (tblID, argus) {
            $('#IPTO').remove();
            $('#txtStoreAccessValue').removeAttr("name");
            Edit = 0;
            switch (tblID) {
                case "gdvIP":
                    isIP = true;
                    storeAccessVar = "IP address";
                    $('#txtStoreAccessValue').prop("name", "ipAddress1");
                    $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Edit IP Range From:"));
                    $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Edit IP Range"));
                    $('
<asp:Label ID="lblIpRangeTo" Text="To:"runat="server" CssClass="cssClassLabel">' + getLocale(AspxStoreAccessManagement, "To:") + '</asp:Label> 	<input type="text" id="txtStoreAccessValueTo" class="sfInputbox"  name="ipAddress" />
').insertAfter('#forIPonly');

                    Edit = argus[0];
                    StoreAccessKeyID = argus[8];
                    $('#txtStoreAccessValue').val(argus[3].split('-')[0]);
                    $('#txtStoreAccessValueTo').val(argus[3].split('-')[1]);
                    $('#txtReason').val(argus[4]);
                    if (argus[6].toLowerCase() == 'true' || argus[6].toLowerCase() == "yes" || argus[6].toLowerCase() == 'active') {
                        $('#chkStatusActive').prop('checked', true);
                    } else if (argus[6].toLowerCase() == 'false' || argus[6].toLowerCase() == "no" || argus[6].toLowerCase() == 'inactive') {
                        $('#chkStarusDisActive').prop('checked', true);
                    }
                    ShowPopupControl("popuprel");
                    break;
                case "gdvEmail":
                    isIP = false;
                    storeAccessVar = "Email";
                    $('#txtStoreAccessValue').prop("name", "Email2");
                    $('#' + lblStoreAccessValueID).html("Edit Email:");
                    $('#' + lblAddEditStoreAccessTitleID).html("Edit Email");
                    Edit = argus[0];
                    StoreAccessKeyID = argus[8];
                    $('#txtStoreAccessValue').val(argus[3]);
                    $('#txtReason').val(argus[4]);

                    if (argus[6].toLowerCase() == 'true' || argus[6].toLowerCase() == "yes" || argus[6].toLowerCase() == 'active') {
                        $('#chkStatusActive').prop('checked', true);
                    } else if (argus[6].toLowerCase() == 'false' || argus[6].toLowerCase() == "no" || argus[6].toLowerCase() == 'inactive') {
                        $('#chkStarusDisActive').prop('checked', true);
                    }
                    ShowPopupControl("popuprel");

                    break;
                case "gdvDomain":
                    isIP = false;
                    $('#txtStoreAccessValue').prop("name", "website");
                    storeAccessVar = "Domain";
                    $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Edit Domain Name: "));
                    $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Edit Domain"));
                    Edit = argus[0];
                    StoreAccessKeyID = argus[8];
                    $('#txtStoreAccessValue').val(argus[3]);
                    $('#txtReason').val(argus[4]);
                    if (argus[6].toLowerCase() == 'true' || argus[6].toLowerCase() == "yes" || argus[6].toLowerCase() == 'active') {
                        $('#chkStatusActive').prop('checked', true);
                    } else if (argus[6].toLowerCase() == 'false' || argus[6].toLowerCase() == "no" || argus[6].toLowerCase() == 'inactive') {
                        $('#chkStarusDisActive').prop('checked', true);
                    }
                    ShowPopupControl("popuprel");

                    break;
                case "gdvCreditCard":
                    isIP = false;
                    storeAccessVar = "Credit card";
                    $('#txtStoreAccessValue').prop("name", "Credit");
                    $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Edit Credit Card No: "));
                    $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Edit Credit Card"));
                    Edit = argus[0];
                    StoreAccessKeyID = argus[8];
                    $('#txtStoreAccessValue').val(argus[3]);
                    $('#txtReason').val(argus[4]);
                    if (argus[6].toLowerCase() == 'true' || argus[6].toLowerCase() == "yes" || argus[6].toLowerCase() == 'active') {
                        $('#chkStatusActive').prop('checked', true);
                    } else if (argus[6].toLowerCase() == 'false' || argus[6].toLowerCase() == "no" || argus[6].toLowerCase() == 'inactive') {
                        $('#chkStarusDisActive').prop('checked', true);
                    }
                    ShowPopupControl("popuprel");
                    break;
                case "gdvCustomer":
                    isIP = false;
                    storeAccessVar = "Customer";
                    $('#' + lblStoreAccessValueID).html(getLocale(AspxStoreAccessManagement, "Edit Customer Name: "));
                    $('#' + lblAddEditStoreAccessTitleID).html(getLocale(AspxStoreAccessManagement, "Edit Customer"));
                    Edit = argus[0];
                    StoreAccessKeyID = argus[8];
                    $('#txtStoreAccessValue').val(argus[3]);
                    $('#txtReason').val(argus[4]);

                    if (argus[6].toLowerCase() == 'true' || argus[6].toLowerCase() == "yes" || argus[6].toLowerCase() == 'active') {
                        $('#chkStatusActive').prop('checked', true);
                    } else if (argus[6].toLowerCase() == 'false' || argus[6].toLowerCase() == "no" || argus[6].toLowerCase() == 'inactive') {
                        $('#chkStarusDisActive').prop('checked', true);
                    }
                    ShowPopupControl("popuprel");
                    $('#txtStoreAccessValue').autocomplete("enable");
                    $('#txtStoreAccessValue').autocomplete({
                        source: function (request, response) {
                            $.ajax({
                                url: aspxservicePath + "AspxCoreHandler.ashx/GetAspxUser", beforeSend: function (request) {
                                    request.setRequestHeader('ASPX-TOKEN', _aspx_token);
                                    request.setRequestHeader("UMID", umi);
                                    request.setRequestHeader("UName", AspxCommerce.utils.GetUserName());
                                    request.setRequestHeader("PID", AspxCommerce.utils.GetPortalID());
                                    request.setRequestHeader("PType", "v");
                                    request.setRequestHeader('Escape', '0');
                                },
                                data: JSON2.stringify({ userName: $('#txtStoreAccessValue').val(), aspxCommonObj: aspxCommonObj }),
                                dataType: "json",
                                type: "POST",
                                contentType: "application/json; charset=utf-8",
                                dataFilter: function (data) { return data; },
                                success: function (data) {
                                    if (auto) {
                                        response($.map(data.d, function (item) {
                                            return {
                                                value: item.UserName
                                            };
                                        }));
                                    }
                                },
                                error: function (XMLHttpRequest, textStatus, errorThrown) {
                                    csscody.error('
' + getLocale(AspxStoreAccessManagement, "Error Message") + '

' + textStatus + '
');
                                }
                            });
                        },
                        minLength: 2
                    });
                    break;
                default:
                    break;
            }
        },

        DeleteCoupons: function (tblID, argus) {
            var properties = {
                onComplete: function (e) {
                    StoreAccessmanage.DeleteStoreAccessByID(argus[0], e);
                }
            };
            csscody.confirm("
" + getLocale(AspxStoreAccessManagement, "Delete Confirmation") + "

" + getLocale(AspxStoreAccessManagement, "Are you sure you want to delete?") + "
", properties);
        },

        DeleteStoreAccessByID: function (Ids, event) {
            if (event) {
                this.config.url = this.config.baseURL + "DeletStoreAccess";
                this.config.data = JSON2.stringify({ storeAccessID: Ids, aspxCommonObj: aspxCommonObj });
                this.config.ajaxCallMode = 3;
                this.ajaxCall(this.config);
            }
        },

        LoadStoreAccessCustomers: function (search, startdate, enddate, status) {
            this.config.method = "LoadStoreAccessCustomer";
            var offset_ = 1;
            var current_ = 1;
            var perpage = ($("gdvCustomer_pagesize").length > 0) ? $("#gdvCustomer_pagesize :selected").text() : 10;

            $("#gdvCustomer").sagegrid({
                url: this.config.baseURL,
                functionMethod: this.config.method,
                colModel: [
                    { display: getLocale(AspxStoreAccessManagement, 'Ids'), name: 'Ids', cssclass: 'cssClassHeadCheckBox', coltype: 'checkbox', align: 'center', elemClass: 'attrChkbox', elemDefault: false, controlclass: 'itemsHeaderChkbox' },
                    { display: getLocale(AspxStoreAccessManagement, 'Customer Name'), name: 'Customer', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Reason'), name: 'Reason', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Added On'), name: 'Added On', cssclass: 'cssClassHeadDate', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Status'), name: 'Status', cssclass: 'cssClassHeadBoolean', controlclass: '', coltype: 'label', align: 'left', type: 'boolean', format: 'Active/Inactive' },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyType'), name: 'KeyType', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyID'), name: 'KeyID', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'Actions'), name: 'action', cssclass: 'cssClassAction', coltype: 'label', align: 'center' }
                ],
                buttons: [
                    { display: getLocale(AspxStoreAccessManagement, 'Edit'), name: 'edit', enable: true, _event: 'click', trigger: '1', callMethod: 'StoreAccessmanage.EditCoupons', arguments: '1,2,3,4,5,6,7' },
                    { display: getLocale(AspxStoreAccessManagement, 'Delete'), name: 'delete', enable: true, _event: 'click', trigger: '2', callMethod: 'StoreAccessmanage.DeleteCoupons', arguments: '1' }
                ],
                rp: perpage,
                nomsg: getLocale(AspxStoreAccessManagement, "No Records Found!"),
                param: { search: search, startDate: startdate, endDate: enddate, status: status, aspxCommonObj: aspxCommonObj },
                current: current_,
                pnew: offset_,
                sortcol: { 0: { sorter: false }, 7: { sorter: false } }
            });
        },

        LoadStoreAccessCreditCards: function (search, startdate, enddate, status) {

            var offset_ = 1;
            var current_ = 1;
            var perpage = ($("gdvCreditCard_pagesize").length > 0) ? $("#gdvCreditCard_pagesize :selected").text() : 10;

            $("#gdvCreditCard").sagegrid({
                url: aspxservicePath + "AspxCoreHandler.ashx/",
                functionMethod: 'LoadStoreAccessCreditCards',
                colModel: [
                    { display: getLocale(AspxStoreAccessManagement, 'Ids'), name: 'Ids', cssclass: 'cssClassHeadCheckBox', coltype: 'checkbox', align: 'center', elemClass: 'attrChkbox', elemDefault: false, controlclass: 'itemsHeaderChkbox' },
                    { display: getLocale(AspxStoreAccessManagement, 'Credit Card'), name: 'Credit Card', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Reason'), name: 'Reason', cssclass: '', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Added On'), name: 'Added On', cssclass: 'cssClassHeadDate', controlclass: '', coltype: 'label', align: 'left' },
                    { display: getLocale(AspxStoreAccessManagement, 'Status'), name: 'Status', cssclass: 'cssClassHeadBoolean', controlclass: '', coltype: 'label', align: 'left', type: 'boolean', format: 'Active/Inactive' },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyType'), name: 'KeyType', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'KeyID'), name: 'KeyID', cssclass: 'cssClassHeadNumber', controlclass: '', coltype: 'label', align: 'left', hide: true },
                    { display: getLocale(AspxStoreAccessManagement, 'Actions'), name: 'action', cssclass: 'cssClassAction', coltype: 'label', align: 'center' }
                ],
                buttons: [
                    { display: getLocale(AspxStoreAccessManagement, 'Edit'), name: 'edit', enable: true, _event: 'click', trigger: '1', callMethod: 'StoreAccessmanage.EditCoupons', arguments: '1,2,3,4,5,6,7' },
                    { display: getLocale(AspxStoreAccessManagement, 'Delete'), name: 'delete', enable: true, _event: 'click', trigger: '2', callMethod: 'StoreAccessmanage.DeleteCoupons', arguments: '1' }
                ],
                rp: perpage,
                nomsg: getLocale(AspxStoreAccessManagement, "No Records Found!"),
                param: { search: search, startDate: startdate, endDate: enddate, status: status, aspxCommonObj: aspxCommonObj },
                current: current_,
                pnew: offset_,
                sortcol: { 0: { sorter: false }, 7: { sorter: false } }
            });
        },
        ajaxSuccess: function (data) {
            switch (StoreAccessmanage.config.ajaxCallMode) {
                case 0:
                    break;
                case 1:
                    StoreAccessmanage.bindAll();
                    if (Edit > 0) {
                        csscody.info('
' + getLocale(AspxStoreAccessManagement, "Successful Message") + '

' + storeAccessVar + getLocale(AspxStoreAccessManagement, ' has been updated successfully.') + '
');
                    } else {
                        csscody.info('
' + getLocale(AspxStoreAccessManagement, "Successful Message") + '

' + storeAccessVar + getLocale(AspxStoreAccessManagement, ' has been saved successfully.') + '
');
                    }
                    Edit = 0;
                    StoreAccessData = '';
                    break;
                case 2:
                    if (data.d.length > 0) {
                        $.each(data.d, function (index, item) {
                            $('#hdnField').append('<input type="hidden" name=' + item.StoreAccessKeyValue + ' value=' + item.StoreAccessKeyID + ' />');
                        });
                    }
                    break;
                case 3:
                    if (!dletemsgonce) {
                        setTimeout(function () {
                            StoreAccessmanage.bindAll();
                        }, 1000);
                        dletemsgonce = true;
                        csscody.info('
' + getLocale(AspxStoreAccessManagement, "Successful Message") + "

" + getLocale(AspxStoreAccessManagement, " Deleted successful. ") + '
');

                    }
                    break;

            }
        }
    };
    StoreAccessmanage.init();
});


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
	$Id: Template.hbm.xml 3939 2010-10-27 08:41:36Z orangeforjava $
-->
<hibernate-mapping package="org.openuap.cms.tpl.model">
	<class name="Template" table="cms_tpl">
		<id name="id" type="long">
			<column name="id" precision="22" scale="0" />
			<generator class="native" />
		</id>
		<property name="tcid" type="long">
			<column name="tcid" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="tplName" type="string">
			<column name="tplName" length="200" not-null="true" />
		</property>
		<property name="tplTitle" type="string">
			<column name="tplTitle" length="200" />
		</property>
		<property name="tplImg" type="string">
			<column name="tplImg" length="200" />
		</property>
		<property name="tplPath" type="string">
			<column name="tplPath" length="200" not-null="true" />
		</property>
		<property name="tplContent" type="text">
			<column name="tplContent" />
		</property>
		<property name="tplIntro" type="text">
			<column name="tplIntro" />
		</property>
		<property name="tplType" type="long">
			<column name="tplType" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="tplStatus" type="long">
			<column name="tplStatus" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="tplSort" type="long">
			<column name="tplSort" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="tplTop" type="long">
			<column name="tplTop" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="tplPink" type="long">
			<column name="tplPink" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="creationUid" type="long">
			<column name="creationUid" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="creationUserName" type="string">
			<column name="creationUserName" length="200"
				not-null="true" />
		</property>
		<property name="lastModifiedUid" type="long">
			<column name="lastModifiedUid" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="creationDate" type="long">
			<column name="creationDate" precision="22" scale="0"
				not-null="true" />
		</property>
		<property name="modifiedDate" type="long">
			<column name="modifiedDate" precision="22" scale="0"
				not-null="true" />
		</property>
	</class>
</hibernate-mapping>


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | resource id |
**type** | **String** |  |
**attributes** | [**JsonApiAttributes**](JsonApiAttributes.md) |  | [optional]
**meta** | [**JsonApiMeta**](JsonApiMeta.md) |  | [optional]
**relationships** | [**StorageRelationships**](StorageRelationships.md) |  | [optional]
**links** | [**JsonApiLinks**](JsonApiLinks.md) |  | [optional]

## Enum: TypeEnum

* `objects` (value: `"objects"`)


text:
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * Content provider for testing content URLs.
 */

package org.chromium.chrome.test;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.database.AbstractCursor;
import android.database.Cursor;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import android.util.Log;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.Map;

/**
 * Content provider for testing content:// urls.
 * Note: if you move this class, make sure you have also updated AndroidManifest.xml
 *
 * Important note about including chromium classes in this content provider:
 * TestContentProvider is part of ChromePublicTest APK. However the instrumentation tests
 * run in the process of the package under test, which is Chrome apk. Normally this is not
 * a problem, however when debug is set to true, Chromium build files enable multidex. In
 * multidex mode, the Chromium files main dex file is in Chrome apk, which are not accessible
 * from the process that runs this ContentProvider.
 *
 * One of the possible workarounds is running this ContentProvider in the same process with
 * Chrome apk (i.e the process that runs the instrumentation tests). However, this
 * requires declaring a sharedUserId between the Chrome apk and ChromePublicTestApk and
 * then setting the target process for ContentProvider for the instrumentation target package.
 *     android:process="{{manifest_package}}"
 *
 * Note that modifying the application manifest file could be problematic as Chrome has
 * side by side channels.
 *
 * The second one is moving the TestContentProvider to the ChromeTestSuport apk. This
 * seems a lot better path than above.
 */
public class TestContentProvider extends ContentProvider {
    private static final String ANDROID_DATA_FILE_PATH = "android/";
    private static final String AUTHORITY = "org.chromium.chrome.test.TestContentProvider";
    private static final String CONTENT_SCHEME = "content://";
    private static final String GET_RESOURCE_REQUEST_COUNT = "get_resource_request_count";
    private static final String RESET_RESOURCE_REQUEST_COUNTS = "reset_resource_request_counts";
    private static final String SET_DATA_PATH = "set_data_path";
    private static final String TAG = "TestContentProvider";
    private enum ColumnIndex {
        RESOURCE_REQUEST_COUNT_COLUMN,
    }
    private Map<String, Integer> mResourceRequestCount;
    private String mDataFilePath;

    // Content providers can be accessed from multiple threads.
    private Object mLock = new Object();

    public static String createContentUrl(String target) {
        return CONTENT_SCHEME + AUTHORITY + "/" + target;
    }

    private static Uri createRequestUri(final String target, String resource) {
        if (resource == null) {
            return Uri.parse(createContentUrl(target));
        } else {
            return Uri.parse(createContentUrl(target) + "?" + resource);
        }
    }

    public static void setDataFilePath(Context context, String resource) {
        Uri uri = createRequestUri(SET_DATA_PATH, resource);
        context.getContentResolver().query(uri, null, null, null, null);
    }

    public static int getResourceRequestCount(Context context, String resource) {
        Uri uri = createRequestUri(GET_RESOURCE_REQUEST_COUNT, resource);
        final Cursor cursor = context.getContentResolver().query(uri, null, null, null, null);
        try {
            cursor.moveToFirst();
            return cursor.getInt(ColumnIndex.RESOURCE_REQUEST_COUNT_COLUMN.ordinal());
        } finally {
            cursor.close();
        }
    }

    public static void resetResourceRequestCounts(Context context) {
        Uri uri = createRequestUri(RESET_RESOURCE_REQUEST_COUNTS, null);
        // A null cursor is returned for this request.
        context.getContentResolver().query(uri, null, null, null, null);
    }

    @Override
    public boolean onCreate() {
        return true;
    }

    @Override
    public ParcelFileDescriptor openFile(final Uri uri, String mode) throws FileNotFoundException {
        String resource = uri.getLastPathSegment();
        synchronized (mLock) {
            if (mResourceRequestCount.containsKey(resource)) {
                mResourceRequestCount.put(resource, mResourceRequestCount.get(resource) + 1);
            } else {
                mResourceRequestCount.put(resource, 1);
            }
        }
        try {
            return ParcelFileDescriptor.open(
                    new File(mDataFilePath + "/" + ANDROID_DATA_FILE_PATH + resource),
                    ParcelFileDescriptor.MODE_READ_ONLY);
        } catch (IOException e) {
            Log.e(TAG, e.getMessage(), e);
        }
        return null;
    }

    @Override
    public String getType(Uri uri) {
        return URLConnection.guessContentTypeFromName(uri.getLastPathSegment());
    }

    @Override
    public int update(Uri uri, ContentValues values, String where,
                      String[] whereArgs) {
        return 0;
    }

    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        return 0;
    }

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        return null;
    }

    /**
     * Cursor object for retrieving resource request counters.
     */
    private static class ProviderStateCursor extends AbstractCursor {
        private final int mResourceRequestCount;

        public ProviderStateCursor(int resourceRequestCount) {
            mResourceRequestCount = resourceRequestCount;
        }

        @Override
        public boolean isNull(int columnIndex) {
            return columnIndex != ColumnIndex.RESOURCE_REQUEST_COUNT_COLUMN.ordinal();
        }

        @Override
        public int getCount() {
            return 1;
        }

        @Override
        public int getType(int columnIndex) {
            if (columnIndex == ColumnIndex.RESOURCE_REQUEST_COUNT_COLUMN.ordinal()) {
                return Cursor.FIELD_TYPE_INTEGER;
            }
            return Cursor.FIELD_TYPE_NULL;
        }

        private void unsupported() {
            throw new UnsupportedOperationException();
        }

        @Override
        public double getDouble(int columnIndex) {
            unsupported();
            return 0.0;
        }

        @Override
        public float getFloat(int columnIndex) {
            unsupported();
            return 0.0f;
        }

        @Override
        public int getInt(int columnIndex) {
            if (columnIndex == ColumnIndex.RESOURCE_REQUEST_COUNT_COLUMN.ordinal()) {
                return mResourceRequestCount;
            }
            return -1;
        }

        @Override
        public short getShort(int columnIndex) {
            unsupported();
            return 0;
        }

        @Override
        public long getLong(int columnIndex) {
            return getInt(columnIndex);
        }

        @Override
        public String getString(int columnIndex) {
            unsupported();
            return null;
        }

        @Override
        public String[] getColumnNames() {
            return new String[] { GET_RESOURCE_REQUEST_COUNT };
        }
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String selection,
                        String[] selectionArgs, String sortOrder) {
        synchronized (mLock) {
            String action = uri.getLastPathSegment();
            String resource = uri.getQuery();
            if (GET_RESOURCE_REQUEST_COUNT.equals(action)) {
                return new ProviderStateCursor(mResourceRequestCount.containsKey(resource)
                        ? mResourceRequestCount.get(resource) : 0);
            } else if (RESET_RESOURCE_REQUEST_COUNTS.equals(action)) {
                mResourceRequestCount = new HashMap<String, Integer>();
            } else if (SET_DATA_PATH.equals(action)) {
                mDataFilePath = resource;
            }
            return null;
        }
    }
}


text:
package org.renjin.primitives;

import org.renjin.eval.Context;
import org.renjin.eval.EvalException;
import org.renjin.primitives.annotations.processor.ArgumentException;
import org.renjin.primitives.annotations.processor.ArgumentIterator;
import org.renjin.sexp.BuiltinFunction;
import org.renjin.sexp.Environment;
import org.renjin.sexp.FunctionCall;
import org.renjin.sexp.PairList;
import org.renjin.sexp.RawVector;
import org.renjin.sexp.SEXP;

public class R$primitive$rawToBits
    extends BuiltinFunction
{

    public R$primitive$rawToBits() {
        super("rawToBits");
    }

    public SEXP apply(Context context, Environment environment, FunctionCall call, PairList args) {
        try {
            ArgumentIterator argIt = new ArgumentIterator(context, environment, args);
            SEXP s0 = argIt.evalNext();
            if (!argIt.hasNext()) {
                return this.doApply(context, environment, s0);
            }
            throw new EvalException("rawToBits: too many arguments, expected at most 1.");
        } catch (ArgumentException e) {
            throw new EvalException(context, "Invalid argument: %s. Expected:\n\trawToBits(RawVector)", e.getMessage());
        } catch (EvalException e) {
            e.initContext(context);
            throw e;
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new EvalException(e);
        }
    }

    public static SEXP doApply(Context context, Environment environment, FunctionCall call, String[] argNames, SEXP[] args) {
        try {
            if ((args.length) == 1) {
                return doApply(context, environment, args[ 0 ]);
            }
        } catch (EvalException e) {
            e.initContext(context);
            throw e;
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new EvalException(e);
        }
        throw new EvalException("rawToBits: max arity is 1");
    }

    public SEXP apply(Context context, Environment environment, FunctionCall call, String[] argNames, SEXP[] args) {
        return R$primitive$rawToBits.doApply(context, environment, call, argNames, args);
    }

    public static SEXP doApply(Context context, Environment environment, SEXP arg0)
        throws Exception
    {
        if (arg0 instanceof RawVector) {
            return Types.rawToBits(((RawVector) arg0));
        } else {
            throw new EvalException(String.format("Invalid argument:\n\trawToBits(%s)\n\tExpected:\n\trawToBits(RawVector)", arg0 .getTypeName()));
        }
    }

}