public JsonResult AccessPolicy(tblAccessPolicy AccessPolicy)
 {
     try
     {
         BLCustomer customerBL = new BLCustomer();
         AccessPolicy.CustomerID = SessionHelper.UserSession.CustomerID;
         customerBL.SaveAccessPolicy(AccessPolicy);
     }
     catch
     {
         ModelState.AddModelError("", "Error occurred durung Customer Information save.");
         return Json(new { errors = KeyValue.GetErrorsFromModelState(ViewData) });
     }
     return Json(new { success = true, Tab = "AP" });
 }
예제 #2
0
        public tblAccessPolicy GetAccessPolicyByID(int AccessPolicyID)
        {
            int errorNum = 0;
            string errorDesc = "";
            DataAccess.resetParams();
            DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, 0);
            DataAccess.addSqlParam("@AccessPolicyID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicyID);
            DataSet ds = DataAccess.ExecuteDataSet(GET_ACCESSPLOY, ref errorNum, ref errorDesc);

            tblAccessPolicy rowDetails = new tblAccessPolicy();
            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dtCutomer = ds.Tables[0];
                if (dtCutomer != null && dtCutomer.Rows.Count > 0)
                {
                    DataRow dr = dtCutomer.Rows[0];
                    rowDetails.AccessPolicyType = new PolicyType();
                    rowDetails.AccessPolicyType.ID = Common.ConvertToInt(dr, "AccessPolicyType");
                    rowDetails.CustomerID = Common.ConvertToInt(dr, "CustomerID");

                    switch (rowDetails.AccessPolicyType.ID)
                    {
                        case 1:
                            rowDetails.AccessPolicyIDWR = Common.ConvertToInt(dr, "AccessPolicyID");
                            rowDetails.RemoteControlPermissionWR = new OptionType();
                            rowDetails.RemoteControlPermissionWR.ID = Common.ConvertToInt(dr, "RemoteControlPermission");
                            rowDetails.RemoteControlPermissionWR.Name = LookUpValue.GetOptionType(rowDetails.RemoteControlPermissionWR.ID.Value);
                            rowDetails.RebootWindowEndTimeWR = Common.ConvertToString(dr, "RebootWindowEndTime");
                            rowDetails.RebootPermissionWR = new OptionType();
                            rowDetails.RebootPermissionWR.ID = Common.ConvertToInt(dr, "RebootPermission");
                            rowDetails.RebootPermissionWR.Name = LookUpValue.GetOptionType(rowDetails.RebootPermissionWR.ID.Value);
                            rowDetails.RebootWindowStartTimeWR = Common.ConvertToString(dr, "RebootWindowStartTime");
                            rowDetails.RemoteAccessStartTimeWR = Common.ConvertToString(dr, "RemoteAccessStartTime");
                            rowDetails.RemoteAccessEndTimeWR = Common.ConvertToString(dr, "RemoteAccessEndTime");
                            rowDetails.RemoteAccessTimeZoneWR = new TimeZoneFX();
                            rowDetails.RemoteAccessTimeZoneWR.ID = Common.ConvertToInt(dr, "RemoteAccessTimeZone");
                            rowDetails.RemoteAccessTimeZoneWR.Name = LookUpValue.GetTimeZone(rowDetails.RemoteAccessTimeZoneWR.ID.Value);
                            rowDetails.RebootTimeZoneWR = new TimeZoneFX();
                            rowDetails.RebootTimeZoneWR.ID = Common.ConvertToInt(dr, "RebootTimeZone");
                            rowDetails.RebootTimeZoneWR.Name = LookUpValue.GetTimeZone(rowDetails.RebootTimeZoneWR.ID.Value);
                            break;
                        case 2:
                            rowDetails.RemoteAccessStartTimeSR = Common.ConvertToString(dr, "RemoteAccessStartTime");
                            rowDetails.AccessPolicyIDSR = Common.ConvertToInt(dr, "AccessPolicyID");
                            rowDetails.RemoteControlPermissionSR = new OptionType();
                            rowDetails.RemoteControlPermissionSR.ID = Common.ConvertToInt(dr, "RemoteControlPermission");
                            rowDetails.RemoteControlPermissionSR.Name = LookUpValue.GetOptionType(rowDetails.RemoteControlPermissionSR.ID.Value);
                            rowDetails.RebootWindowEndTimeSR = Common.ConvertToString(dr, "RebootWindowEndTime");
                            rowDetails.RebootPermissionSR = new OptionType();
                            rowDetails.RebootPermissionSR.ID = Common.ConvertToInt(dr, "RebootPermission");
                            rowDetails.RebootPermissionSR.Name = LookUpValue.GetOptionType(rowDetails.RebootPermissionSR.ID.Value);
                            rowDetails.RebootWindowStartTimeSR = Common.ConvertToString(dr, "RebootWindowStartTime");
                            rowDetails.RemoteAccessEndTimeSR = Common.ConvertToString(dr, "RemoteAccessEndTime");
                            rowDetails.RemoteAccessTimeZoneSR = new TimeZoneFX();
                            rowDetails.RemoteAccessTimeZoneSR.ID = Common.ConvertToInt(dr, "RemoteAccessTimeZone");
                            rowDetails.RemoteAccessTimeZoneSR.Name = LookUpValue.GetTimeZone(rowDetails.RemoteAccessTimeZoneSR.ID.Value);
                            rowDetails.RebootTimeZoneSR = new TimeZoneFX();
                            rowDetails.RebootTimeZoneSR.ID = Common.ConvertToInt(dr, "RebootTimeZone");
                            rowDetails.RebootTimeZoneSR.Name = LookUpValue.GetTimeZone(rowDetails.RebootTimeZoneSR.ID.Value);
                            break;
                        case 3:
                            rowDetails.RemoteAccessStartTimeND = Common.ConvertToString(dr, "RemoteAccessStartTime");
                            rowDetails.AccessPolicyIDND = Common.ConvertToInt(dr, "AccessPolicyID");
                            rowDetails.RemoteControlPermissionND = new OptionType();
                            rowDetails.RemoteControlPermissionND.ID = Common.ConvertToInt(dr, "RemoteControlPermission");
                            rowDetails.RemoteControlPermissionND.Name = LookUpValue.GetOptionType(rowDetails.RemoteControlPermissionND.ID.Value);
                            rowDetails.RebootWindowEndTimeND = Common.ConvertToString(dr, "RebootWindowEndTime");
                            rowDetails.RebootWindowStartTimeND = Common.ConvertToString(dr, "RebootWindowStartTime");
                            rowDetails.RemoteAccessEndTimeND = Common.ConvertToString(dr, "RemoteAccessEndTime");
                            rowDetails.RemoteAccessTimeZoneND = new TimeZoneFX();
                            rowDetails.RemoteAccessTimeZoneND.ID = Common.ConvertToInt(dr, "RemoteAccessTimeZone");
                            rowDetails.RemoteAccessTimeZoneND.Name = LookUpValue.GetTimeZone(rowDetails.RemoteAccessTimeZoneND.ID.Value);
                            rowDetails.RebootPermissionND = new OptionType();
                            rowDetails.RebootPermissionND.ID = Common.ConvertToInt(dr, "RebootPermission");
                            rowDetails.RebootPermissionND.Name = LookUpValue.GetOptionType(rowDetails.RebootPermissionND.ID.Value);
                            rowDetails.RebootTimeZoneND = new TimeZoneFX();
                            rowDetails.RebootTimeZoneND.ID = Common.ConvertToInt(dr, "RebootTimeZone");
                            rowDetails.RebootTimeZoneND.Name = LookUpValue.GetTimeZone(rowDetails.RebootTimeZoneND.ID.Value);
                            break;
                    }
                }
            }
            return rowDetails;
        }
        internal void FillDropDownList(ref List<tblMaintenancePolicy> Manitenancepoly, ref List<tblAccessPolicy> Accesspoly, ref List<tblAntiVirusPolicy> Antiviruspoly, ref List<tblBackUpPolicy> Backuppoly, ref List<tblPatchingPolicy> PatchingPoly, ref List<tbltoolInfomation> ToolInfoPoly)
        {
            int errorNum = 0;
            string errorDesc = "";

            DataAccess.resetParams();
            DataAccess.addSqlParam("@ClientSiteDeviceID", ParameterDirection.Input, 16, MySqlDbType.Int32);
            DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, SessionHelper.UserSession.CustomerID);
            DataSet ds = DataAccess.ExecuteDataSet(GET_CLIENT_SITE_DEVICE, ref errorNum, ref errorDesc);
            Manitenancepoly = new List<tblMaintenancePolicy>();
            Manitenancepoly.Add(new tblMaintenancePolicy() { MaintenancePolicyID = 0, ActivityName = "-- Select --" });
            DataTable dttblmaintinance = ds.Tables[3];
            if (dttblmaintinance != null && dttblmaintinance.Rows.Count > 0)
            {
                foreach (DataRow dPP in dttblmaintinance.Rows)
                {
                    tblMaintenancePolicy tblmaintinance = new tblMaintenancePolicy();
                    tblmaintinance.MaintenancePolicyID = Common.ConvertToInt(dPP, "MaintenancePolicyID");
                    tblmaintinance.ActivityName = Common.ConvertToString(dPP, "ActivityName");
                    Manitenancepoly.Add(tblmaintinance);

                }

            }
            ToolInfoPoly = new List<tbltoolInfomation>();
            ToolInfoPoly.Add(new tbltoolInfomation() { ToolIDRT = 0, RMMTool ="-- Select --"});
            DataTable dttbltoolinfomation = ds.Tables[1];
            if (dttbltoolinfomation != null && dttbltoolinfomation.Rows.Count > 0)
            {
                //  DataRow dTI = dttbltoolinfomation.Rows[1];
                foreach (DataRow dTI in dttbltoolinfomation.Rows)
                {
                    tbltoolInfomation toolInfo = new tbltoolInfomation();
                    toolInfo.ToolIDRT = Common.ConvertToInt(dTI, "ToolID");
                    toolInfo.RMMTool = Common.ConvertToString(dTI, "ToolInfomationName");
                    ToolInfoPoly.Add(toolInfo);
                }
            }
            Accesspoly = new List<tblAccessPolicy>();
            Accesspoly.Add(new tblAccessPolicy() { AccessPolicyID = 0, productname = "-- Select --" });
            DataTable dttblAccpolicy = ds.Tables[4];
            if (dttblAccpolicy != null && dttblAccpolicy.Rows.Count > 0)
            {
                foreach (DataRow dAP in dttblAccpolicy.Rows)
                {
                    tblAccessPolicy tblaccess = new tblAccessPolicy();
                    tblaccess.AccessPolicyID = Common.ConvertToInt(dAP, "AccessPolicyID");
                    tblaccess.productname = Common.ConvertToString(dAP, "productname");
                    Accesspoly.Add(tblaccess);
                }
            }
            PatchingPoly = new List<tblPatchingPolicy>();
            PatchingPoly.Add(new tblPatchingPolicy() { PatchingPolicyIDWR = 0, PolicyNameND ="-- Select --"});
            DataTable dttblPatchingpolicy = ds.Tables[2];
            if (dttblPatchingpolicy != null && dttblPatchingpolicy.Rows.Count > 0)
            {
                //  DataRow dTI = dttbltoolinfomation.Rows[1];
                foreach (DataRow dPP in dttblPatchingpolicy.Rows)
                {
                    tblPatchingPolicy tblpatch = new tblPatchingPolicy();
                    tblpatch.PatchingPolicyIDWR = Common.ConvertToInt(dPP, "PatchingPolicyID");
                    tblpatch.PolicyNameND = Common.ConvertToString(dPP, "PolicyNameND");
                    PatchingPoly.Add(tblpatch);
                }
            }

            Antiviruspoly = new List<tblAntiVirusPolicy>();
            Antiviruspoly.Add(new tblAntiVirusPolicy() { AntiVirusID = 0, PolicyName = "-- Select --" });
            DataTable dttblAantivspolicy = ds.Tables[5];
            if (dttblAantivspolicy != null && dttblAantivspolicy.Rows.Count > 0)
            {
                foreach (DataRow dAP in dttblAantivspolicy.Rows)
                {
                    tblAntiVirusPolicy tblantivirus = new tblAntiVirusPolicy();
                    tblantivirus.AntiVirusID = Common.ConvertToInt(dAP, "AntiVirusID");
                    tblantivirus.PolicyName = Common.ConvertToString(dAP, "PolicyName");
                    Antiviruspoly.Add(tblantivirus);
                }
            }
            Backuppoly = new List<tblBackUpPolicy>();
            Backuppoly.Add(new tblBackUpPolicy() { BackUpPolicyID = 0, PolicyName = "-- Select --" });
            DataTable dttblBackupspolicy = ds.Tables[6];
            if (dttblBackupspolicy != null && dttblBackupspolicy.Rows.Count > 0)
            {
                foreach (DataRow dAP in dttblBackupspolicy.Rows)
                {
                    tblBackUpPolicy tblbackup = new tblBackUpPolicy();
                    tblbackup.BackUpPolicyID = Common.ConvertToInt(dAP, "BackUpPolicyID");
                    tblbackup.PolicyName = Common.ConvertToString(dAP, "PolicyName");
                    Backuppoly.Add(tblbackup);
                }
            }
        }
예제 #4
0
        public int SaveAccessPolicy(tblAccessPolicy AccessPolicy)
        {
            int errorNum = 0;
            string errorDesc = "";
            AccessPolicy.AccessPolicyType = new PolicyType();

            if (AccessPolicy.RemoteControlPermissionWR.ID.Value == 2)
            {
                DataAccess.resetParams();
                DataAccess.addSqlParam("@AccessPolicyID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyIDWR);
                DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.CustomerID);
                DataAccess.addSqlParam("@RemoteControlPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RemoteAccessStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RemoteAccessEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RemoteAccessTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RebootPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RebootWindowStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RebootWindowEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@AccessPolicyType", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyType.ID = 1);
                DataAccess.addSqlParam("@RebootTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@Identity", ParameterDirection.InputOutput, 16, MySqlDbType.Int32);
                DataAccess.ExecuteNonQuery(SET_AccessPolicy, ref errorNum, ref errorDesc);
            }
            else
            {

                DataAccess.resetParams();
                DataAccess.addSqlParam("@AccessPolicyID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyIDWR);
                DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.CustomerID);
                DataAccess.addSqlParam("@RemoteControlPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RemoteControlPermissionWR.ID);
                DataAccess.addSqlParam("@RemoteAccessStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RemoteAccessStartTimeWR);
                DataAccess.addSqlParam("@RemoteAccessEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RemoteAccessEndTimeWR);
                DataAccess.addSqlParam("@RemoteAccessTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RemoteAccessTimeZoneWR.ID);
                DataAccess.addSqlParam("@RebootPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RebootPermissionWR.ID);
                DataAccess.addSqlParam("@RebootWindowStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RebootWindowStartTimeWR);
                DataAccess.addSqlParam("@RebootWindowEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RebootWindowEndTimeWR);
                DataAccess.addSqlParam("@AccessPolicyType", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyType.ID = 1);
                DataAccess.addSqlParam("@RebootTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RebootTimeZoneWR.ID);
                DataAccess.addSqlParam("@Identity", ParameterDirection.InputOutput, 16, MySqlDbType.Int32);
                DataAccess.ExecuteNonQuery(SET_AccessPolicy, ref errorNum, ref errorDesc);
            }

            if (AccessPolicy.RemoteControlPermissionSR.ID.Value == 2)
            {
                DataAccess.resetParams();
                DataAccess.addSqlParam("@AccessPolicyID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyIDSR);
                DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.CustomerID);
                DataAccess.addSqlParam("@RemoteControlPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RemoteAccessStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RemoteAccessEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RemoteAccessTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RebootPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RebootWindowStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RebootWindowEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@AccessPolicyType", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyType.ID = 2);
                DataAccess.addSqlParam("@RebootTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@Identity", ParameterDirection.InputOutput, 16, MySqlDbType.Int32);
                DataAccess.ExecuteNonQuery(SET_AccessPolicy, ref errorNum, ref errorDesc);
            }
            else
            {
                DataAccess.resetParams();
                DataAccess.addSqlParam("@AccessPolicyID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyIDSR);
                DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.CustomerID);
                DataAccess.addSqlParam("@RemoteControlPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RemoteControlPermissionSR.ID);
                DataAccess.addSqlParam("@RemoteAccessStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RemoteAccessStartTimeSR);
                DataAccess.addSqlParam("@RemoteAccessEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RemoteAccessEndTimeSR);
                DataAccess.addSqlParam("@RemoteAccessTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RemoteAccessTimeZoneSR.ID);
                DataAccess.addSqlParam("@RebootPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RebootPermissionSR.ID);
                DataAccess.addSqlParam("@RebootWindowStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RebootWindowStartTimeSR);
                DataAccess.addSqlParam("@RebootWindowEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RebootWindowEndTimeSR);
                DataAccess.addSqlParam("@AccessPolicyType", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyType.ID = 2);
                DataAccess.addSqlParam("@RebootTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RebootTimeZoneSR.ID);
                DataAccess.addSqlParam("@Identity", ParameterDirection.InputOutput, 16, MySqlDbType.Int32);
                DataAccess.ExecuteNonQuery(SET_AccessPolicy, ref errorNum, ref errorDesc);
            }
            if (AccessPolicy.RemoteControlPermissionND.ID.Value == 2)
            {
                DataAccess.resetParams();
                DataAccess.addSqlParam("@AccessPolicyID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyIDND);
                DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.CustomerID);
                DataAccess.addSqlParam("@RemoteControlPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RemoteAccessStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RemoteAccessEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RemoteAccessTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RebootPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@RebootWindowStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@RebootWindowEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, null);
                DataAccess.addSqlParam("@AccessPolicyType", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyType.ID = 3);
                DataAccess.addSqlParam("@RebootTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, null);
                DataAccess.addSqlParam("@Identity", ParameterDirection.InputOutput, 16, MySqlDbType.Int32);
                DataAccess.ExecuteNonQuery(SET_AccessPolicy, ref errorNum, ref errorDesc);
                return Common.ConvertToInt(DataAccess.getSQLParam("@Identity").ToString());
            }
            else
            {
                DataAccess.resetParams();
                DataAccess.addSqlParam("@AccessPolicyID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyIDND);
                DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.CustomerID);
                DataAccess.addSqlParam("@RemoteControlPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RemoteControlPermissionND.ID);
                DataAccess.addSqlParam("@RemoteAccessStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RemoteAccessStartTimeND);
                DataAccess.addSqlParam("@RemoteAccessEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RemoteAccessEndTimeND);
                DataAccess.addSqlParam("@RemoteAccessTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RemoteAccessTimeZoneND.ID);
                DataAccess.addSqlParam("@RebootPermission", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RebootPermissionND.ID);
                DataAccess.addSqlParam("@RebootWindowStartTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RebootWindowStartTimeND);
                DataAccess.addSqlParam("@RebootWindowEndTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, AccessPolicy.RebootWindowEndTimeND);
                DataAccess.addSqlParam("@AccessPolicyType", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.AccessPolicyType.ID = 3);
                DataAccess.addSqlParam("@RebootTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, AccessPolicy.RebootTimeZoneND.ID);
                DataAccess.addSqlParam("@Identity", ParameterDirection.InputOutput, 16, MySqlDbType.Int32);
                DataAccess.ExecuteNonQuery(SET_AccessPolicy, ref errorNum, ref errorDesc);
                return Common.ConvertToInt(DataAccess.getSQLParam("@Identity").ToString());
            }
        }