// GET
        public ActionResult AntiVirusPolicy(int? AntiVirusID)
        {
            BLCustomer AntiVirusBL = new BLCustomer();
            tblAntiVirusPolicy tblantivirus = new tblAntiVirusPolicy();
            tblantivirus = AntiVirusBL.GetAntiVirus(AntiVirusID.Value);

            List<KeyValue> lstKeyVal = new List<KeyValue>();
            lstKeyVal.Add(new KeyValue() { Key = "Anti-Virus Policy Name", Value = tblantivirus.PolicyName });
            lstKeyVal.Add(new KeyValue() { Key = "Av Product Name", Value = tblantivirus.ProductName });
            lstKeyVal.Add(new KeyValue()
            {
                Key = "Patching Time",
                Value = tblantivirus.PatchingTime + " " + tblantivirus.PatchingTimeZone.ID
            });
            lstKeyVal.Add(new KeyValue() { Key = "Define Week Day (for weekly schedule)", Value = tblantivirus.WeekOfDay.Name });
            lstKeyVal.Add(new KeyValue() { Key = "Define Month of Day (for Monthly Schedule) ", Value = tblantivirus.MonthOfDay.Name });
            lstKeyVal.Add(new KeyValue() { Key = "Anti-Virus Scan Exclusion", Value = tblantivirus.PolicyName });
            lstKeyVal.Add(new KeyValue() { Key = "Exclude files with an extension", Value = tblantivirus.ExcludedFilesExtension });
            lstKeyVal.Add(new KeyValue() { Key = "Exclude File Types", Value = tblantivirus.ExcludedFileTypes });
            lstKeyVal.Add(new KeyValue() { Key = "Exclude File Paths", Value = tblantivirus.ExcludedFilePaths });

            if (Request.IsAjaxRequest())
                return PartialView("Detail", lstKeyVal);
            else
                return View("Detail", lstKeyVal);
        }
        // GET
        public ActionResult AntiVirusPolicy(int? AntiVirusID)
        {
            BLCustomer AntiVirusBL = new BLCustomer();
            tblAntiVirusPolicy tblantivirus = new tblAntiVirusPolicy();
            tblantivirus = AntiVirusBL.GetAntiVirus(AntiVirusID.Value);

            ViewBag.staus = LookUpData.GetSetUpStatus();
            ViewBag.ScheduleAV = LookUpData.GetScheduleType();
            ViewBag.SearchTypes = LookUpData.GetPolicyType();

            ViewBag.WeekOfDayAV = LookUpData.GetWeekOfDay();
            ViewBag.time = LookUpData.GetFXTime();
            ViewBag.MonthOfDayAV = LookUpData.GetMonthOfDay();
            ViewBag.TimeZones = LookUpData.GetTimeZone();
            ViewBag.ScheduleType = LookUpData.GetScheduleType();

            if (Request.IsAjaxRequest())
                return PartialView(tblantivirus);
            else
                return View(tblantivirus);
        }
        public JsonResult AntiVirusPolicy(tblAntiVirusPolicy AntiVirus)
        {
            try
            {
                BLCustomer customerBL = new BLCustomer();
                AntiVirus.CustomerID = SessionHelper.UserSession.CustomerID;
                customerBL.SaveAntiVirusPolicy(AntiVirus);
            }
            catch
            {
                ModelState.AddModelError("", "Error occurred durung Customer Information save.");
                return Json(new { errors = KeyValue.GetErrorsFromModelState(ViewData) });
            }

            return Json(new { success = true, Tab = "VP" });
        }
        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);
                }
            }
        }
示例#5
0
        public List<tblAntiVirusPolicy> GetAVPIndex(int CustomerID, int pageNumber, int pageSize, int sortColumnIndex, string sortOrder, string searchText, ref int totalRecords)
        {
            int errorNum = 0;
            string errorDesc = "";
            DataAccess.resetParams();
            DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, CustomerID);
            DataAccess.addSqlParam("@pageNumber", ParameterDirection.Input, 16, MySqlDbType.Int32, pageNumber);
            DataAccess.addSqlParam("@pageRecord", ParameterDirection.Input, 16, MySqlDbType.Int32, pageSize);
            DataAccess.addSqlParam("@sortColumnIndex", ParameterDirection.Input, 16, MySqlDbType.Int32, sortColumnIndex);
            DataAccess.addSqlParam("@searchOrder", ParameterDirection.Input, 4, MySqlDbType.VarChar, sortOrder);
            DataAccess.addSqlParam("@searchText", ParameterDirection.Input, 100, MySqlDbType.VarChar, searchText);

            DataSet ds = DataAccess.ExecuteDataSet(GET_AVPINDX, ref errorNum, ref errorDesc);
            tblAntiVirusPolicy antiVirus = new tblAntiVirusPolicy();

            List<tblAntiVirusPolicy> antiViruss = new List<tblAntiVirusPolicy>();
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {

                DataTable dtAntiVirus = ds.Tables[0];
                totalRecords = Common.ConvertToInt(dtAntiVirus.Rows[0], "TotalRecords");
                if (dtAntiVirus != null && dtAntiVirus.Rows.Count > 0)
                {
                    foreach (DataRow dr in dtAntiVirus.Rows)
                    {
                        antiVirus = new tblAntiVirusPolicy();
                        antiVirus.WeekOfDay = new WeekOfDay();
                        antiVirus.MonthOfDay = new MonthOfDay();
                        antiVirus.PatchingTimeZone = new TimeZoneFX();

                        antiVirus.ScheduleType = new ScheduleType();
                        antiVirus.CustomerID = Common.ConvertToInt(dr, "CustomerID");
                        antiVirus.AntiVirusID = Common.ConvertToInt(dr, "AntiVirusID");
                        antiVirus.PatchingTime = Common.ConvertToString(dr, "PatchingTime");

                        antiVirus.PatchingTimeZone.ID = Common.ConvertToInt(dr, "PatchingTimeZone");
                        antiVirus.PatchingTimeZone.Name = LookUpValue.GetTimeZone(antiVirus.PatchingTimeZone.ID.Value);
                        antiVirus.WeekOfDay.ID = Common.ConvertToInt(dr, "WeekOfDay");
                        antiVirus.WeekOfDay.Name = LookUpValue.GetWeekOfDay(antiVirus.WeekOfDay.ID.Value);
                        antiVirus.MonthOfDay.ID = Common.ConvertToInt(dr, "MonthOfDay");
                        antiVirus.MonthOfDay.Name = LookUpValue.GetMonthOfDays(antiVirus.MonthOfDay.ID.Value);
                        antiVirus.PolicyName = Common.ConvertToString(dr, "PolicyName");
                        antiVirus.ProductName = Common.ConvertToString(dr, "ProductName");
                        antiVirus.ExcludedFilesExtension = Common.ConvertToString(dr, "ExcludedFilesExtension");
                        antiVirus.ExcludedFileTypes = Common.ConvertToString(dr, "ExcludedFileTypes");
                        antiVirus.ExcludedFilePaths = Common.ConvertToString(dr, "ExcludedFilePaths");
                        antiVirus.PatchingTimeZone.ID = Common.ConvertToInt(dr, "PatchingTimeZone");
                        antiVirus.PatchingTimeZone.Name = LookUpValue.GetTimeZone(antiVirus.PatchingTimeZone.ID.Value);
                        antiViruss.Add(antiVirus);
                    }
                }
            }
            return antiViruss;
        }
示例#6
0
        public tblAntiVirusPolicy GetAntiVirus(int AntiVirusID)
        {
            int errorNum = 0;
            string errorDesc = "";
            DataAccess.resetParams();
            DataAccess.addSqlParam("@oAntiVirusID", ParameterDirection.Input, 16, MySqlDbType.Int32, AntiVirusID);
            DataSet ds = DataAccess.ExecuteDataSet(GET_ANTIVIRUS, ref errorNum, ref errorDesc);
            tblAntiVirusPolicy antiVirus = new tblAntiVirusPolicy();

            if (ds != null && ds.Tables.Count > 0)
            {

                DataTable dtAntiVirus = ds.Tables[0];
                if (dtAntiVirus != null && dtAntiVirus.Rows.Count > 0)
                {

                    DataRow dr = dtAntiVirus.Rows[0];
                    antiVirus = new tblAntiVirusPolicy();
                    antiVirus.WeekOfDay = new WeekOfDay();
                    antiVirus.MonthOfDay = new MonthOfDay();
                    antiVirus.PatchingTimeZone = new TimeZoneFX();
                    //  antiVirus.PatchingTime = new FXTime();

                    antiVirus.CustomerID = Common.ConvertToInt(dr, "CustomerID");
                    antiVirus.AntiVirusID = Common.ConvertToInt(dr, "AntiVirusID");
                    antiVirus.PatchingTime = Common.ConvertToString(dr, "PatchingTime");
                    antiVirus.PatchingTimeZone.ID = Common.ConvertToInt(dr, "PatchingTimeZone");
                    antiVirus.WeekOfDay.ID = Common.ConvertToInt(dr, "WeekOfDay");
                    antiVirus.MonthOfDay.ID = Common.ConvertToInt(dr, "MonthOfDay");
                    antiVirus.PolicyName = Common.ConvertToString(dr, "PolicyName");
                    antiVirus.ProductName = Common.ConvertToString(dr, "ProductName");
                    antiVirus.ExcludedFilesExtension = Common.ConvertToString(dr, "ExcludedFilesExtension");
                    antiVirus.ExcludedFileTypes = Common.ConvertToString(dr, "ExcludedFileTypes");
                    antiVirus.ExcludedFilePaths = Common.ConvertToString(dr, "ExcludedFilePaths");

                    antiVirus.PatchingTimeZone.Name = LookUpValue.GetTimeZone(antiVirus.PatchingTimeZone.ID.Value);
                    // antiVirus.PatchingTime.Name = LookUpValue.GetFXTime(antiVirus.PatchingTime.ID.Value);
                    antiVirus.WeekOfDay.Name = LookUpValue.GetWeekOfDay(antiVirus.WeekOfDay.ID.Value);
                    antiVirus.MonthOfDay.Name = LookUpValue.GetMonthOfDays(antiVirus.MonthOfDay.ID.Value);

                }
            }
            return antiVirus;
        }
示例#7
0
        public int SaveAntiVirusPolicy(tblAntiVirusPolicy antiVirus)
        {
            int errorNum = 0;
            string errorDesc = "";

            DataAccess.resetParams();
            DataAccess.addSqlParam("@AntiVirusID", ParameterDirection.Input, 16, MySqlDbType.Int32, antiVirus.AntiVirusID);
            DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, antiVirus.CustomerID);
            DataAccess.addSqlParam("@PolicyName", ParameterDirection.Input, 100, MySqlDbType.VarChar, antiVirus.PolicyName);
            DataAccess.addSqlParam("@ProductName", ParameterDirection.Input, 100, MySqlDbType.VarChar, antiVirus.ProductName);
            DataAccess.addSqlParam("@SetupStatus", ParameterDirection.Input, 16, MySqlDbType.Int32, antiVirus.SetupStatus);
            DataAccess.addSqlParam("@PatchingTime", ParameterDirection.Input, 10, MySqlDbType.VarChar, antiVirus.PatchingTime);
            DataAccess.addSqlParam("@PatchingTimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, antiVirus.PatchingTimeZone.ID);
            DataAccess.addSqlParam("@WeekOfDay", ParameterDirection.Input, 16, MySqlDbType.Int32, antiVirus.WeekOfDay.ID);
            DataAccess.addSqlParam("@MonthofDay", ParameterDirection.Input, 16, MySqlDbType.Int32, antiVirus.MonthOfDay.ID);
            DataAccess.addSqlParam("@ExcludedFilesExtension", ParameterDirection.Input, 100, MySqlDbType.VarChar, antiVirus.ExcludedFilesExtension);
            DataAccess.addSqlParam("@ExcludedFileTypes", ParameterDirection.Input, 100, MySqlDbType.VarChar, antiVirus.ExcludedFileTypes);
            DataAccess.addSqlParam("@ExcludedFilePaths", ParameterDirection.Input, 100, MySqlDbType.VarChar, antiVirus.ExcludedFilePaths);

            DataAccess.addSqlParam("@Identity", ParameterDirection.InputOutput, 16, MySqlDbType.Int32);
            DataAccess.ExecuteNonQuery(SET_AntiVirusPolicy, ref errorNum, ref errorDesc);
            return Common.ConvertToInt(DataAccess.getSQLParam("@Identity").ToString());
        }