public JsonResult getCompliance(string countryid, string industrytypeid)
        {
            if (countryid == "")
            {
                countryid = Convert.ToString(0);
            }
            List <SelectListItem> cities = new List <SelectListItem>();
            int CID = Convert.ToInt32(countryid);

            if (industrytypeid == "")
            {
                industrytypeid = Convert.ToString(0);
            }
            int IndustryID = Convert.ToInt32(industrytypeid);

            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLCompliances = organizationservice.GetComplianceType(CID, IndustryID);
            DataSet dsCompliances     = new DataSet();

            dsCompliances.ReadXml(new StringReader(strXMLCompliances));
            if (dsCompliances.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsCompliances.Tables[0].Rows)
                {
                    cities.Add(new SelectListItem()
                    {
                        Text = row["Compliance_Type_Name"].ToString(), Value = row["Compliance_Type_ID"].ToString()
                    });
                }
            }
            return(Json(cities, JsonRequestBehavior.AllowGet));
        }
        public ActionResult SelectGroupCompany()
        {
            List <SelectListItem> listItems = new List <SelectListItem>();

            listItems.Add(new SelectListItem {
                Text = "-- Select Group Company --", Value = "0"
            });
            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLGroupCompanyList = organizationservice.getGroupCompanyListDropDown();
            DataSet dsGroupCompanyList     = new DataSet();

            dsGroupCompanyList.ReadXml(new StringReader(strXMLGroupCompanyList));

            if (dsGroupCompanyList.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsGroupCompanyList.Tables[0].Rows)
                {
                    if (Convert.ToInt32(Session["GroupCompanyId"]) == Convert.ToInt32(row["Org_Hier_ID"]))
                    {
                        listItems.Add(new SelectListItem()
                        {
                            Text = row["Company_Name"].ToString(), Value = row["Org_Hier_ID"].ToString(), Selected = true
                        });
                    }
                    else
                    {
                        listItems.Add(new SelectListItem()
                        {
                            Text = row["Company_Name"].ToString(), Value = row["Org_Hier_ID"].ToString()
                        });
                    }
                }
            }
            return(PartialView("~/Views/Shared/_SelectGroupCompany.cshtml", listItems));
        }
Example #3
0
 public ActionResult AddVendor(VendorViewModel vendorViewModel)
 {
     if (ModelState.IsValid)
     {
         VendorService.VendorServiceClient    vendorServiceClient = new VendorService.VendorServiceClient();
         OrgService.OrganizationServiceClient organizationClient  = new OrgService.OrganizationServiceClient();
         vendorViewModel.vendor.OrgCompanyID = vendorViewModel.CompanyID;
         vendorViewModel.vendor.IsActive     = true;
         vendorViewModel.vendor.IsDelete     = false;
         vendorViewModel.vendor.UserID       = 1;
         int id = Convert.ToInt32(vendorServiceClient.insertVendor(vendorViewModel.vendor));
         vendorViewModel.vendor.VendorID = id;
         if (id != 0)
         {
             Session["VendorName"] = vendorViewModel.vendor.VendorName;
             Session["VendorID"]   = vendorViewModel.vendor.VendorID;
             Session["CompanyID"]  = vendorViewModel.vendor.OrgCompanyID;
             return(RedirectToAction("AboutVendor"));
         }
         else
         {
             return(View("View"));
         }
     }
     else
     {
         return(View("_Vendor"));
     }
 }
        public JsonResult getdefaultcountry(string compid)
        {
            BranchViewModel branchVM = new BranchViewModel();
            int             ID       = Convert.ToInt32(compid);

            OrgService.OrganizationServiceClient organizationServiceClient = new OrgService.OrganizationServiceClient();
            string  xmldata = organizationServiceClient.getDefaultCompanyDetails(ID);
            DataSet dsDefaultCompanyDetails = new DataSet();

            dsDefaultCompanyDetails.ReadXml(new StringReader(xmldata));
            branchVM.Country = new List <SelectListItem>();
            if (dsDefaultCompanyDetails.Tables.Count > 0)
            {
                branchVM.Country.Add(new SelectListItem()
                {
                    Text = dsDefaultCompanyDetails.Tables[0].Rows[0]["Country_Name"].ToString(), Value = dsDefaultCompanyDetails.Tables[0].Rows[0]["Country_ID"].ToString()
                });
                branchVM.Country.Add(new SelectListItem()
                {
                    Text = dsDefaultCompanyDetails.Tables[0].Rows[0]["State_Name"].ToString(), Value = dsDefaultCompanyDetails.Tables[0].Rows[0]["State_ID"].ToString()
                });
                branchVM.Country.Add(new SelectListItem()
                {
                    Text = dsDefaultCompanyDetails.Tables[0].Rows[0]["City_Name"].ToString(), Value = dsDefaultCompanyDetails.Tables[0].Rows[0]["City_ID"].ToString()
                });
            }
            return(Json(branchVM.Country, JsonRequestBehavior.AllowGet));
        }
        public JsonResult getdefaultindustrytype(int compid)
        {
            List <SelectListItem> cities = new List <SelectListItem>();
            VendorViewModel       model  = new VendorViewModel();

            model.companydetails = new CompanyDetails();
            //int CID = Convert.ToInt32(compid);
            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLIndustry = organizationservice.GetIndustryType();
            DataSet dsIndustry     = new DataSet();

            dsIndustry.ReadXml(new StringReader(strXMLIndustry));
            if (dsIndustry.Tables.Count > 0)
            {
                // model.companydetails.Industry_Type_ID=Convert.ToInt32(dsIndustry.Tables[0].Rows[0]["Industry_Type_ID"]);
                //cities.Add(new SelectListItem() { Text = dsIndustry.Tables[0].Rows[0]["Industry_Name"].ToString(), Value = dsIndustry.Tables[0].Rows[0]["Industry_Type_ID"].ToString() });

                foreach (System.Data.DataRow row in dsIndustry.Tables[0].Rows)
                {
                    cities.Add(new SelectListItem()
                    {
                        Text = row["Industry_Name"].ToString(), Value = row["Industry_Type_ID"].ToString()
                    });
                }
            }
            return(Json(cities, JsonRequestBehavior.AllowGet));
        }
Example #6
0
        public ActionResult AssignRules(string branchid, string vendorid, string vendorname)
        {
            AllocateActandRuleViewModel model = new AllocateActandRuleViewModel();

            model.ActType = new List <SelectListItem>();
            model.ActType.Add(new SelectListItem {
                Text = "Union and State Level", Value = "0"
            });
            model.ActType.Add(new SelectListItem {
                Text = "Union Level", Value = "1"
            });
            model.ActType.Add(new SelectListItem {
                Text = "State Level", Value = "2"
            });

            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            string  xmldata          = client.GetAssignedComplianceTypes(Convert.ToInt32(vendorid));
            DataSet ds               = new DataSet();
            DataSet dscompliancetype = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            int[] compliancetypeid = new int[ds.Tables[0].Rows.Count];
            int   i = 0;

            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    compliancetypeid[i++] = Convert.ToInt32(row["Compliance_Type_ID"]);
                }
            }
            model.AuditType = new List <SelectListItem>();
            ComplianceXrefService.ComplianceXrefServiceClient serviceClient = new ComplianceXrefService.ComplianceXrefServiceClient();
            for (i = 0; i < compliancetypeid.Length; i++)
            {
                xmldata = serviceClient.GetComplainceType(compliancetypeid[i]);
                ds      = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                if (ds.Tables.Count > 0)
                {
                    model.AuditTypeID = Convert.ToInt32(ds.Tables[0].Rows[0]["Compliance_Type_ID"]);
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.AuditType.Add(new SelectListItem {
                            Text = Convert.ToString(row["Compliance_Type_Name"]), Value = Convert.ToString(row["Compliance_Type_ID"])
                        });
                    }
                }
            }

            model.BranchId        = Convert.ToInt32(branchid);
            model.Name            = vendorname;
            Session["Branch_Id"]  = branchid;
            Session["BranchName"] = vendorname;
            Session["VendorId"]   = vendorid;
            return(View("_AssignRules", model));
        }
Example #7
0
        public ActionResult CreateActs()
        {
            ComplianceViewModel model = new ComplianceViewModel();

            model.Countrylist = new List <SelectListItem>();
            model.Countrylist.Add(new SelectListItem()
            {
                Text = "--Select Country--", Value = "0"
            });
            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLCountries = organizationservice.GetCountryList();
            DataSet dsCountries     = new DataSet();

            dsCountries.ReadXml(new StringReader(strXMLCountries));
            if (dsCountries.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsCountries.Tables[0].Rows)
                {
                    model.Countrylist.Add(new SelectListItem()
                    {
                        Text = row["Country_Name"].ToString(), Value = row["Country_ID"].ToString()
                    });
                }
            }

            model.Statelist = new List <SelectListItem>();
            model.Statelist.Add(new SelectListItem()
            {
                Text = "--Select State--", Value = "0"
            });

            model.Citylist = new List <SelectListItem>();
            model.Citylist.Add(new SelectListItem()
            {
                Text = "--Select City--", Value = "0"
            });

            model.ActType = new List <SelectListItem>();
            model.ActType.Add(new SelectListItem {
                Text = "--Select Act Type--", Value = "0"
            });
            model.ActType.Add(new SelectListItem {
                Text = "Union Level", Value = "1"
            });
            model.ActType.Add(new SelectListItem {
                Text = "State Level", Value = "2"
            });
            model.ActType.Add(new SelectListItem {
                Text = "City Level", Value = "3"
            });

            model.Compliance = new ComplianceXref();
            model.Compliance.Compliance_Xref_ID = 0;
            Session["Actmodel"] = model;
            return(PartialView("_AddActs", model));
        }
Example #8
0
        public ActionResult selectbranch(AuditorpageViewModel model)
        {
            model.companyList = new List <SelectListItem>();
            model.BranchList  = new List <SelectListItem>();
            model.VendorList  = new List <Organization>();

            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            int     groupid = Convert.ToInt32(Session["GroupCompanyId"]);
            string  xmldata = client.getCompanyListDropDown(groupid);
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            model.companyList = new List <SelectListItem>();
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    model.companyList.Add(new SelectListItem {
                        Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                    });
                }
            }
            model.BranchList = new List <SelectListItem>();
            xmldata          = client.GeSpecifictBranchList(model.companyid);
            ds = new DataSet();
            ds.ReadXml(new StringReader(xmldata));
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    model.BranchList.Add(new SelectListItem {
                        Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                    });
                }
            }

            VendorService.VendorServiceClient vendorServiceClient = new VendorService.VendorServiceClient();
            xmldata = vendorServiceClient.GetAssignedVendorsforBranch(model.branchid);
            ds      = new DataSet();
            ds.ReadXml(new StringReader(xmldata));
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    model.VendorList.Add(new Organization {
                        Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Vendor_ID"]), logo = Convert.ToString(row["logo"])
                    });
                }
            }
            else
            {
                TempData["Message"] = "No Vendors assigned for the selected branch.";
            }

            return(View("_SelectBranch", model));
        }
        public void setGroupCompanyDetails(int groupcompanyid)
        {
            OrgService.OrganizationServiceClient organizationServiceClient = new OrgService.OrganizationServiceClient();

            string  xmlData = organizationServiceClient.getParticularGroupCompaniesList(groupcompanyid);
            DataSet dataSet = new DataSet();

            dataSet.ReadXml(new StringReader(xmlData));
            if (dataSet.Tables.Count > 0)
            {
                System.Web.HttpContext.Current.Session["GroupCompanyName"] = Convert.ToString(dataSet.Tables[0].Rows[0]["Company_Name"]);
            }
        }
Example #10
0
        public ActionResult selectauditfrequency(int branchid, int vendorid, string vendorname)
        {
            Compliancetype_view_model model = new Compliancetype_view_model();

            model.compliance_Types = new List <compliance_type>();
            model.branchid         = branchid;
            model.vendorid         = vendorid;
            model.vendorname       = vendorname;
            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            string  xmldata          = client.GetAssignedComplianceTypes(vendorid);
            DataSet ds               = new DataSet();
            DataSet dscompliancetype = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            int[] compliancetypeid = new int[ds.Tables[0].Rows.Count];
            int   i = 0;

            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    compliancetypeid[i++] = Convert.ToInt32(row["Compliance_Type_ID"]);
                }
            }

            ComplianceXrefService.ComplianceXrefServiceClient serviceClient = new ComplianceXrefService.ComplianceXrefServiceClient();
            for (i = 0; i < compliancetypeid.Length; i++)
            {
                xmldata = serviceClient.GetComplainceType(compliancetypeid[i]);
                ds      = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                if (ds.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.compliance_Types.Add(new compliance_type
                        {
                            complianceid   = Convert.ToInt32(row["Compliance_Type_ID"]),
                            auditfrequency = Convert.ToInt32(row["Audit_Frequency"]),
                            Name           = Convert.ToString(row["Compliance_Type_Name"]),
                            startdate      = Convert.ToDateTime(row["Start_Date"]),
                            enddate        = Convert.ToDateTime(row["End_Date"])
                        });
                    }
                }
            }



            return(View("_SelectFrequency", model));
        }
        public JsonResult getyear(int compid, int compliancetypeid)
        {
            int             sd    = 0;
            int             ed    = 0;
            List <string>   years = new List <string>();
            ReportViewModel model = new ReportViewModel();

            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strxmlcompliancetype = organizationservice.GetParticularCompliance(compliancetypeid);
            DataSet dsComplianceType     = new DataSet();

            dsComplianceType.ReadXml(new StringReader(strxmlcompliancetype));
            if (dsComplianceType.Tables.Count > 0)
            {
                string   ComplianceName = Convert.ToString(dsComplianceType.Tables[0].Rows[0]["Compliance_Type_Name"]);
                DateTime StartDate      = Convert.ToDateTime(dsComplianceType.Tables[0].Rows[0]["Start_Date"]);
                DateTime EndDate        = Convert.ToDateTime(dsComplianceType.Tables[0].Rows[0]["End_date"]);

                sd = StartDate.Year;
                ed = EndDate.Year;
            }

            string  strxmlyear = organizationservice.getDefaultCompanyDetails(compid);
            DataSet dsyear     = new DataSet();

            dsyear.ReadXml(new StringReader(strxmlyear));
            if (dsyear.Tables.Count > 0)
            {
                model.StartDate = Convert.ToDateTime(dsyear.Tables[0].Rows[0]["Calender_StartDate"]);
                model.yearid    = model.StartDate.Year;
                if (sd == ed)
                {
                    model.years = Enumerable.Range(model.yearid, DateTime.Now.Year - (model.yearid - 1)).OrderByDescending(i => i);
                    //model.yearid = DateTime.Now.Year;
                }
                else
                {
                    int count = DateTime.Now.Year - (model.yearid - 1);
                    for (int i = 1; i <= count; i++)
                    {
                        years.Add(model.yearid.ToString() + "-" + (model.yearid + 1));
                        ++model.yearid;
                    }
                    years.Reverse();

                    return(Json(years, JsonRequestBehavior.AllowGet));
                }
            }
            return(Json(model.years, JsonRequestBehavior.AllowGet));
        }
Example #12
0
        public ActionResult AddVendor()
        {
            int             id = 0;
            VendorViewModel vendorViewModel = new VendorViewModel();

            VendorService.VendorServiceClient    vendorServiceClient       = new VendorService.VendorServiceClient();
            OrgService.OrganizationServiceClient organizationServiceClient = new OrgService.OrganizationServiceClient();
            vendorViewModel.vendor          = new VendorMaster();
            vendorViewModel.vendor.VendorID = 0;

            string  strXMLGroupCompanyList = organizationServiceClient.GetGroupCompaniesList();
            DataSet dsGroupCompanyList     = new DataSet();

            dsGroupCompanyList.ReadXml(new StringReader(strXMLGroupCompanyList));
            vendorViewModel.GroupCompaniesList = new List <SelectListItem>();
            vendorViewModel.GroupCompaniesList.Add(new SelectListItem {
                Text = "--Select Group Company--", Value = "0"
            });

            foreach (System.Data.DataRow row in dsGroupCompanyList.Tables[0].Rows)
            {
                vendorViewModel.GroupCompaniesList.Add(new SelectListItem()
                {
                    Text = row["Company_Name"].ToString(), Value = row["Org_Hier_ID"].ToString()
                });
            }


            string  strXMLCompanyList = organizationServiceClient.GeSpecifictCompaniesList(id);
            DataSet dsCompanyList     = new DataSet();

            dsCompanyList.ReadXml(new StringReader(strXMLCompanyList));
            vendorViewModel.CompaniesList = new List <SelectListItem>();
            vendorViewModel.CompaniesList.Add(new SelectListItem {
                Text = "--Select Company--", Value = "0"
            });

            foreach (System.Data.DataRow row in dsCompanyList.Tables[0].Rows)
            {
                vendorViewModel.CompaniesList.Add(new SelectListItem()
                {
                    Text = row["Company_Name"].ToString(), Value = row["Org_Hier_ID"].ToString()
                });
            }



            return(View("_Vendor", vendorViewModel));
        }
        public ActionResult IndustryTypeMapwithCompliance()
        {
            ComplianceIndustryViewModel model = new ComplianceIndustryViewModel();
            OrgService.OrganizationServiceClient organizationService = new OrgService.OrganizationServiceClient();
            model.IndustryType = new Compliance.DataObject.IndustryType();
            model.ComplianceType = new Compliance.DataObject.ComplianceType();
            string strXMLCountries = organizationService.GetCountryList();
            DataSet dsCountries = new DataSet();
            dsCountries.ReadXml(new StringReader(strXMLCountries));
            model.CountryList = new List<SelectListItem>();
            model.CountryList.Add(new SelectListItem { Text = "-- Select Country --", Value = "" });
            if (dsCountries.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsCountries.Tables[0].Rows)
                {
                    model.CountryList.Add(new SelectListItem() { Text = row["Country_Name"].ToString(), Value = row["Country_ID"].ToString() });
                }
            }

            string strXMLIndustryType = organizationService.GetIndustryType();
            DataSet dsIndustryType = new DataSet();
            dsIndustryType.ReadXml(new StringReader(strXMLIndustryType));
            model.IndustryTypeList = new List<SelectListItem>();
            model.IndustryTypeList.Add(new SelectListItem { Text = "-- Industry Type --", Value = "" });
            if (dsIndustryType.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsIndustryType.Tables[0].Rows)
                {
                    model.IndustryTypeList.Add(new SelectListItem() { Text = row["Industry_Name"].ToString(), Value = row["Industry_Type_ID"].ToString() });
                }
            }

            //string strXMLComplianceTypes = organizationService.getAllComplianceTypes();
            //DataSet dsComplianceTypes = new DataSet();
            //dsComplianceTypes.ReadXml(new StringReader(strXMLIndustryType));
            //model.ComplianceTypeList = new List<SelectListItem>();
            //model.ComplianceTypeList.Add(new SelectListItem { Text = "-- Industry Type --", Value = "" });
            //if (dsComplianceTypes.Tables.Count > 0)
            //{
            //    foreach (System.Data.DataRow row in dsComplianceTypes.Tables[0].Rows)
            //    {
            //        model.ComplianceTypeList.Add(new SelectListItem() { Text = row["Compliance_Type_Name"].ToString(), Value = row["Compliance_Type_ID"].ToString() });
            //    }
            //}

            return View("_MapComplianceTypes", model);
        }
Example #14
0
        public ActionResult SMEdashboard(AllocateActandRuleViewModel model)
        {
            model.Companylist = new  List <SelectListItem>();
            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            int     groupid = Convert.ToInt32(Session["GroupCompanyId"]);
            string  xmldata = client.getCompanyListDropDown(groupid);
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            model.Companylist = new List <SelectListItem>()
            {
                new SelectListItem {
                    Text = "--Select Company--", Value = "0"
                }
            };
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    model.Companylist.Add(new SelectListItem {
                        Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                    });
                }
            }
            model.Branch = new List <Organization>();
            xmldata      = client.GeSpecifictBranchList(model.CompanyId);
            ds           = new DataSet();
            ds.ReadXml(new StringReader(xmldata));
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    model.Branch.Add(new Organization {
                        Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Org_Hier_ID"])
                    });
                    //model.BranchList.Add(new SelectListItem { Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"]) });
                }
            }


            return(View("_SMEDashboard", model));
        }
        public ActionResult GetComplianceToBindGrid(string countryid, string industrytypeid)
        {
            List <ComplianceIndustryViewModel> objCompList = new List <ComplianceIndustryViewModel>();

            if (countryid == "")
            {
                countryid = Convert.ToString(0);
            }
            int CID = Convert.ToInt32(countryid);

            if (industrytypeid == "")
            {
                industrytypeid = Convert.ToString(0);
            }
            int IndustryID = Convert.ToInt32(industrytypeid);

            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLCompliances = organizationservice.GetComplianceType(CID, IndustryID);
            DataSet dsCompliances     = new DataSet();

            dsCompliances.ReadXml(new StringReader(strXMLCompliances));
            if (dsCompliances.Tables.Count > 0)
            {
                //ComplianceIndustryViewModel objComp1 = new ComplianceIndustryViewModel();
                //objComp1.CountryName = Convert.ToString(dsCompliances.Tables[0].Rows[0]["Country_Name"]);
                //objComp1.IndustryName = dsCompliances.Tables[0].Rows[0]["Industry_Name"].ToString();
                //objCompList.Add(objComp1);
                for (int i = 0; i < dsCompliances.Tables[0].Rows.Count; i++)
                {
                    ComplianceIndustryViewModel objComp = new ComplianceIndustryViewModel();

                    objComp.CountryName    = Convert.ToString(dsCompliances.Tables[0].Rows[i]["Country_Name"]);
                    objComp.IndustryName   = dsCompliances.Tables[0].Rows[i]["Industry_Name"].ToString();
                    objComp.ComplianceType = new ComplianceType();
                    objComp.ComplianceType.ComplianceTypeName = dsCompliances.Tables[0].Rows[i]["Compliance_Type_Name"].ToString();
                    objComp.ComplianceType.ComplianceTypeID   = Convert.ToInt32(dsCompliances.Tables[0].Rows[i]["Compliance_Type_ID"]);
                    objCompList.Add(objComp);
                }
            }
            return(Json(objCompList, JsonRequestBehavior.AllowGet));
        }
        public JsonResult getspecificbranchdropdown(string compid)
        {
            List <SelectListItem> company = new List <SelectListItem>();
            int ID = Convert.ToInt32(compid);

            OrgService.OrganizationServiceClient organizationServiceClient = new OrgService.OrganizationServiceClient();
            string  xmldata = organizationServiceClient.getSpecificBranchListDropDown(ID);
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            company = new List <SelectListItem>();
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    company.Add(new SelectListItem {
                        Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                    });
                }
            }
            return(Json(company, JsonRequestBehavior.AllowGet));
        }
        public JsonResult getCompanyDetailsfroVendor(int compid, string industrytypeid)
        {
            int industryTypeID = 0;

            if (industrytypeid != "")
            {
                industryTypeID = Convert.ToInt32(industrytypeid);
            }
            List <SelectListItem> compliance = new List <SelectListItem>();
            VendorViewModel       vendorVM   = new VendorViewModel();

            vendorVM.location = new BranchLocation();
            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLCompanyDetails = organizationservice.getDefaultCompanyDetails(compid);
            DataSet dsCompanyDetails     = new DataSet();

            dsCompanyDetails.ReadXml(new StringReader(strXMLCompanyDetails));
            if (dsCompanyDetails.Tables.Count > 0)
            {
                vendorVM.location.Country_Id  = Convert.ToInt32(dsCompanyDetails.Tables[0].Rows[0]["Country_ID"]);
                vendorVM.location.State_Id    = Convert.ToInt32(dsCompanyDetails.Tables[0].Rows[0]["State_ID"]);
                vendorVM.location.City_Id     = Convert.ToInt32(dsCompanyDetails.Tables[0].Rows[0]["City_ID"]);
                vendorVM.location.Postal_Code = Convert.ToString(dsCompanyDetails.Tables[0].Rows[0]["Postal_Code"]);
                string  strCompliances = organizationservice.GetComplianceType(industryTypeID, vendorVM.location.Country_Id);
                DataSet dsCompliances  = new DataSet();
                dsCompliances.ReadXml(new StringReader(strCompliances));
                if (dsCompliances.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow row in dsCompliances.Tables[0].Rows)
                    {
                        compliance.Add(new SelectListItem()
                        {
                            Text = row["Compliance_Type_Name"].ToString(), Value = row["Compliance_Type_ID"].ToString()
                        });
                    }
                }
            }
            return(Json(compliance, JsonRequestBehavior.AllowGet));
        }
        public JsonResult getcompliancelistundercompany(string compid)
        {
            List <SelectListItem> cities = new List <SelectListItem>();
            int CID = Convert.ToInt32(compid);

            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLCompliances = organizationservice.GetAssignedComplianceTypes(CID);
            DataSet dsCompliances     = new DataSet();

            dsCompliances.ReadXml(new StringReader(strXMLCompliances));
            if (dsCompliances.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsCompliances.Tables[0].Rows)
                {
                    cities.Add(new SelectListItem()
                    {
                        Text = row["Compliance_Type_Name"].ToString(), Value = row["Compliance_Type_ID"].ToString()
                    });
                }
            }
            return(Json(cities, JsonRequestBehavior.AllowGet));
        }
        public JsonResult getcity(string stateid)
        {
            List <SelectListItem> cities = new List <SelectListItem>();
            int ID = Convert.ToInt32(stateid);

            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLCities = organizationservice.GetCityList(ID);
            DataSet dsCities     = new DataSet();

            dsCities.ReadXml(new StringReader(strXMLCities));
            if (dsCities.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsCities.Tables[0].Rows)
                {
                    cities.Add(new SelectListItem()
                    {
                        Text = row["City_Name"].ToString(), Value = row["City_ID"].ToString()
                    });
                }
            }
            return(Json(cities, JsonRequestBehavior.AllowGet));
        }
        // GET: Common

        public JsonResult getstate(string countryid)
        {
            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            int ID = Convert.ToInt32(countryid);
            List <SelectListItem> state = new List <SelectListItem>();
            string  strXMLStates        = organizationservice.GetStateList(ID);
            DataSet dsstate             = new DataSet();


            dsstate.ReadXml(new StringReader(strXMLStates));
            if (dsstate.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsstate.Tables[0].Rows)
                {
                    state.Add(new SelectListItem()
                    {
                        Text = row["State_Name"].ToString(), Value = row["State_ID"].ToString()
                    });
                }
            }
            return(Json(state, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Listofvendors(int branchid)
        {
            AllocateActandRuleViewModel model = new AllocateActandRuleViewModel();

            model.BranchId = branchid;
            model.Branch   = new List <Organization>();
            OrgService.OrganizationServiceClient service = new OrgService.OrganizationServiceClient();
            string  xmldata = service.getBranch(model.BranchId);
            DataSet data    = new DataSet();

            data.ReadXml(new StringReader(xmldata));
            model.Branch.Add(new Organization
            {
                Company_Id        = Convert.ToInt32(data.Tables[0].Rows[0]["Org_Hier_ID"]),
                Company_Name      = Convert.ToString(data.Tables[0].Rows[0]["Company_Name"]),
                Parent_Company_Id = Convert.ToInt32(data.Tables[0].Rows[0]["Parent_Company_ID"]),
                logo = Convert.ToString(data.Tables[0].Rows[0]["logo"])
            });
            model.Vendor = new List <Organization>();
            VendorService.VendorServiceClient vendorServiceClient = new VendorService.VendorServiceClient();
            xmldata = vendorServiceClient.GetAssignedVendorsforBranch(branchid);
            DataSet ds = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    model.Vendor.Add(new Organization {
                        Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Vendor_ID"]), logo = Convert.ToString(row["logo"])
                    });
                }
            }
            else
            {
                TempData["Message"] = "No Vendors assigned for the selected branch.";
            }
            return(View("_Listofvendorforauditing", model));
        }
        public JsonResult getcompany(string groupcompid)
        {
            List <SelectListItem> company = new List <SelectListItem>();
            int ID = Convert.ToInt32(groupcompid);

            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            string  xmldata = client.GeSpecifictCompaniesList(ID);
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            company = new List <SelectListItem>();
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    company.Add(new SelectListItem {
                        Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                    });
                }
            }
            Session["Company"] = company;
            return(Json(company, JsonRequestBehavior.AllowGet));
        }
Example #23
0
        public ActionResult ComplianceActMapping()
        {
            complianceActmappingViewModel model = new complianceActmappingViewModel();

            OrgService.OrganizationServiceClient organizationService = new OrgService.OrganizationServiceClient();
            string  strXMLCountries = organizationService.GetCountryList();
            DataSet dsCountries     = new DataSet();

            dsCountries.ReadXml(new StringReader(strXMLCountries));
            model.Country = new List <SelectListItem>();
            // model.Country.Add(new SelectListItem { Text = "-- Select Country --", Value = "" });
            if (dsCountries.Tables.Count > 0)
            {
                model.countryid = Convert.ToInt32(dsCountries.Tables[0].Rows[0]["Country_ID"]);
                foreach (System.Data.DataRow row in dsCountries.Tables[0].Rows)
                {
                    model.Country.Add(new SelectListItem()
                    {
                        Text = row["Country_Name"].ToString(), Value = row["Country_ID"].ToString()
                    });
                }
            }

            //ComplianceXrefService.ComplianceXrefServiceClient client = new ComplianceXrefService.ComplianceXrefServiceClient();
            //string xmldata = client.GetComplainceType(0);
            //DataSet ds = new DataSet();
            //ds.ReadXml(new StringReader(xmldata));
            model.ComplianceType = new List <SelectListItem>();
            //if (ds.Tables.Count > 0)
            //{
            //    model.compliancetypeid = Convert.ToInt32(ds.Tables[0].Rows[0]["Compliance_Type_ID"]);

            //    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
            //    {
            //        model.ComplianceType.Add(new SelectListItem { Text = Convert.ToString(row["Compliance_Type_Name"]), Value = Convert.ToString(row["Compliance_Type_ID"]) });
            //    }
            //}

            string  strXMLIndustryType = organizationService.GetIndustryType();
            DataSet dsIndustryType     = new DataSet();

            dsIndustryType.ReadXml(new StringReader(strXMLIndustryType));
            model.IndustryType = new List <SelectListItem>();
            // model.IndustryType.Add(new SelectListItem { Text = "-- Industry Type --", Value = "" });
            if (dsIndustryType.Tables.Count > 0)
            {
                model.industryid = Convert.ToInt32(dsIndustryType.Tables[0].Rows[0]["Industry_Type_ID"]);
                foreach (System.Data.DataRow row in dsIndustryType.Tables[0].Rows)
                {
                    model.IndustryType.Add(new SelectListItem()
                    {
                        Text = row["Industry_Name"].ToString(), Value = row["Industry_Type_ID"].ToString()
                    });
                }
            }

            string  strXMLCompliances = organizationService.GetComplianceType(model.countryid, model.industryid);
            DataSet dsCompliances     = new DataSet();

            dsCompliances.ReadXml(new StringReader(strXMLCompliances));
            if (dsCompliances.Tables.Count > 0)
            {
                model.compliancetypeid      = Convert.ToInt32(dsCompliances.Tables[0].Rows[0]["Compliance_Type_ID"]);
                Session["compliancetypeid"] = Convert.ToInt32(dsCompliances.Tables[0].Rows[0]["Compliance_Type_ID"]);
                foreach (System.Data.DataRow row in dsCompliances.Tables[0].Rows)
                {
                    model.ComplianceType.Add(new SelectListItem()
                    {
                        Text = row["Compliance_Type_Name"].ToString(), Value = row["Compliance_Type_ID"].ToString()
                    });
                }
            }
            return(View("_complianceActMap", model));
        }
Example #24
0
        public ActionResult UpdateAct(int id)
        {
            ComplianceViewModel model = new ComplianceViewModel();

            model.Countrylist = new List <SelectListItem>();
            model.Countrylist.Add(new SelectListItem()
            {
                Text = "--Select Country--", Value = "0"
            });
            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLCountries = organizationservice.GetCountryList();
            DataSet dsCountries     = new DataSet();

            dsCountries.ReadXml(new StringReader(strXMLCountries));
            if (dsCountries.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsCountries.Tables[0].Rows)
                {
                    model.Countrylist.Add(new SelectListItem()
                    {
                        Text = row["Country_Name"].ToString(), Value = row["Country_ID"].ToString()
                    });
                }
            }

            model.Statelist = new List <SelectListItem>();
            model.Statelist.Add(new SelectListItem()
            {
                Text = "--Select State--", Value = "0"
            });

            model.Citylist = new List <SelectListItem>();
            model.Citylist.Add(new SelectListItem()
            {
                Text = "--Select City--", Value = "0"
            });

            model.ActType = new List <SelectListItem>();
            model.ActType.Add(new SelectListItem {
                Text = "--Select Act Type--", Value = "0"
            });
            model.ActType.Add(new SelectListItem {
                Text = "Union Level", Value = "1"
            });
            model.ActType.Add(new SelectListItem {
                Text = "State Level", Value = "2"
            });
            //model.ActType.Add(new SelectListItem { Text = "City Level", Value = "3" });

            ComplianceXrefService.ComplianceXrefServiceClient client = new ComplianceXrefService.ComplianceXrefServiceClient();
            model.ComplianceType = new List <SelectListItem>();
            string  xmldata = client.GetComplainceType();
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            model.ComplianceType.Add(new SelectListItem {
                Text = "-- Select Compliance --", Value = "0"
            });
            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    model.ComplianceType.Add(new SelectListItem {
                        Text = Convert.ToString(row["Compliance_Type_Name"]), Value = Convert.ToString(row["Compliance_Type_ID"])
                    });
                }
            }
            model.Compliance = new ComplianceXref();


            xmldata = client.GetActs(id);
            ds      = new DataSet();
            ds.ReadXml(new StringReader(xmldata));
            model.Compliance.Compliance_Xref_ID    = id;
            model.Compliance.Compliance_Type_ID    = Convert.ToInt32(ds.Tables[0].Rows[0]["Compliance_Type_ID"]);
            model.Compliance.Compliance_Parent_ID  = Convert.ToInt32(ds.Tables[0].Rows[0]["Compliance_Parent_ID"]);
            model.Compliance.Compliance_Title      = Convert.ToString(ds.Tables[0].Rows[0]["Compliance_Title"]);
            model.Compliance.compl_def_consequence = Convert.ToString(ds.Tables[0].Rows[0]["compl_def_consequence"]);
            model.Compliance.City_ID              = Convert.ToInt32(ds.Tables[0].Rows[0]["City_ID"]);
            model.Compliance.Comp_Description     = Convert.ToString(ds.Tables[0].Rows[0]["Comp_Description"]);
            model.Compliance.Effective_End_Date   = Convert.ToDateTime(ds.Tables[0].Rows[0]["Effective_End_Date"]);
            model.Compliance.Effective_Start_Date = Convert.ToDateTime(ds.Tables[0].Rows[0]["Effective_Start_Date"]);
            model.Compliance.State_ID             = Convert.ToInt32(ds.Tables[0].Rows[0]["State_ID"]);
            model.Compliance.Country_ID           = Convert.ToInt32(ds.Tables[0].Rows[0]["Country_ID"]);
            if (model.Compliance.State_ID == 0)
            {
                model.ActTypeID = 1;
            }
            else
            {
                model.ActTypeID = 2;
            }
            return(PartialView("~/Views/ComplianceManagement/UpdateAct.cshtml", model));
        }
 public ActionResult IndustryTypeMapwithCompliance(ComplianceIndustryViewModel model)
 {
     OrgService.OrganizationServiceClient organizationService = new OrgService.OrganizationServiceClient();
     int id = organizationService.insertComplianceTypesMappedWithIndustryType(model.ComplianceType, model.IndustryType);
     return View("");
 }
Example #26
0
        public ActionResult SMEdashboard()
        {
            AllocateActandRuleViewModel model = new AllocateActandRuleViewModel();

            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            int     groupid = Convert.ToInt32(Session["GroupCompanyId"]);
            string  xmldata = client.getCompanyListDropDown(groupid);
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            model.Companylist = new List <SelectListItem>()
            {
                new SelectListItem {
                    Text = "--Select Company--", Value = "0"
                }
            };
            if (ds.Tables.Count > 0)
            {
                model.CompanyId = Convert.ToInt32(ds.Tables[0].Rows[0]["Org_Hier_ID"]);
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    model.Companylist.Add(new SelectListItem {
                        Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                    });
                }
            }

            model.Branch = new List <Organization>();
            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();

            string strxmlCompanies = organizationservice.GeSpecifictBranchList(model.CompanyId);

            DataSet dsSpecificBranchList = new DataSet();

            dsSpecificBranchList.ReadXml(new StringReader(strxmlCompanies));
            if (dsSpecificBranchList.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsSpecificBranchList.Tables[0].Rows)
                {
                    model.Branch.Add(new Organization {
                        Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Org_Hier_ID"])
                    });
                }
            }
            else
            {
                ViewBag.Message = ConfigurationManager.AppSettings["No_Branches"];
            }

            //model.Vendor = new List<Organization>();
            //xmldata = organizationservice.GetVendors(model.CompanyId);
            //ds = new DataSet();
            //ds.ReadXml(new StringReader(xmldata));
            //if (ds.Tables.Count > 0)
            //{
            //    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
            //    {
            //        model.Vendor.Add(new Organization { Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Org_Hier_ID"]) });
            //    }
            //}
            return(View("_SMEDashboard", model));
        }
Example #27
0
        public JsonResult GetJsTree3Data(string audittypeid, string acttype)
        {
            int auditid = Convert.ToInt32(audittypeid);

            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            string  xmldata = client.getorglocation(Convert.ToInt32(Session["Branch_Id"]));
            DataSet loc     = new DataSet();

            loc.ReadXml(new StringReader(xmldata));
            int countryid = Convert.ToInt32(loc.Tables[0].Rows[0]["Country_ID"]);
            int stateid   = 0;
            int cityid    = 0;
            int flag      = Convert.ToInt32(acttype);

            if (acttype == "1")
            {
                countryid = Convert.ToInt32(loc.Tables[0].Rows[0]["Country_ID"]);
                stateid   = 0;
                cityid    = 0;
            }
            else if (acttype == "2")
            {
                stateid = Convert.ToInt32(loc.Tables[0].Rows[0]["State_ID"]);
                cityid  = 0;
            }
            else
            {
                cityid = Convert.ToInt32(loc.Tables[0].Rows[0]["City_ID"]);
            }

            var root = new treenode() //Create our root node and ensure it is opened
            {
                id    = Guid.NewGuid().ToString(),
                text  = "Select All",
                state = new Models.State(true, false, false)
            };
            int orgid    = Convert.ToInt32(Session["Branch_Id"]);
            int vendorid = Convert.ToInt32(Session["VendorId"]);
            //Create a basic structure of nodes
            var children = new List <treenode>();

            ComplianceXrefService.ComplianceXrefServiceClient xrefclient = new ComplianceXrefService.ComplianceXrefServiceClient();

            xmldata = xrefclient.GetcomplianceonType(auditid, countryid, stateid, cityid, flag);
            DataSet dscomp = new DataSet();

            dscomp.ReadXml(new StringReader(xmldata));
            DataTable ds       = new DataTable();
            DataTable dsection = new DataTable();
            DataTable dsrules  = new DataTable();

            if (dscomp.Tables.Count > 0)
            {
                DataView dv = new DataView(dscomp.Tables[0]);
                dv.RowFilter = "level=1";
                ds           = dv.ToTable();

                dv.Table     = dscomp.Tables[0];
                dv.RowFilter = "level=3";
                dsrules      = dv.ToTable();

                dv.Table     = dscomp.Tables[0];
                dv.RowFilter = "level=2";
                dsection     = dv.ToTable();
            }
            else
            {
                TempData["Error"] = "No Rules for the state level";
            }
            xmldata = xrefclient.getRuleforBranch(orgid, vendorid);
            DataSet dsassigenedrule = new DataSet();

            dsassigenedrule.ReadXml(new StringReader(xmldata));

            treenode act = new treenode();

            if (ds.Rows.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Rows)
                {
                    bool isrule = false;
                    act = new treenode {
                        id = row["Compliance_Xref_ID"].ToString(), text = row["Compliance_Title"].ToString(), icon = "fa fa-legal", state = new Models.State(true, false, false), categorytype = "Act", children = new List <treenode>()
                    };
                    if (dsection.Rows.Count > 0)
                    {
                        foreach (System.Data.DataRow section in dsection.Rows)
                        {
                            if (row["Compliance_Xref_ID"].ToString() == section["Compliance_Parent_ID"].ToString())
                            {
                                isrule = false;
                                var sec = new treenode {
                                    id = section["Compliance_Xref_ID"].ToString(), text = section["Compliance_Title"].ToString(), icon = "fa fa-book", state = new Models.State(false, false, false), categorytype = "Section", children = new List <treenode>()
                                };

                                if (dsrules.Rows.Count > 0)
                                {
                                    foreach (System.Data.DataRow rules in dsrules.Rows)
                                    {
                                        if (section["Compliance_Xref_ID"].ToString() == rules["Compliance_Parent_ID"].ToString())
                                        {
                                            isrule = true;
                                            var rule = new treenode {
                                                id = rules["Compliance_Xref_ID"].ToString(), text = rules["Compliance_Title"].ToString(), icon = "fa fa-leanpub", state = new Models.State(false, false, false), categorytype = "Rule", children = new List <treenode>()
                                            };
                                            if (dsassigenedrule.Tables.Count > 0)
                                            {
                                                foreach (System.Data.DataRow assignrules in dsassigenedrule.Tables[0].Rows)
                                                {
                                                    if (assignrules["Compliance_Xref_ID"].ToString() == rules["Compliance_Xref_ID"].ToString())
                                                    {
                                                        rule.state = new Models.State(false, false, true);
                                                        break;
                                                    }
                                                }
                                            }
                                            if (isrule == true)
                                            {
                                                sec.children.Add(rule);
                                            }
                                        }
                                    }
                                }
                                if (isrule == true)
                                {
                                    act.children.Add(sec);
                                }
                            }
                        }
                    }
                    if (isrule == true)
                    {
                        children.Add(act);
                    }
                }
            }
            // Add the sturcture to the root nodes children property
            root.children = children;

            // Return the object as JSON
            return(Json(root, JsonRequestBehavior.AllowGet));
        }
Example #28
0
        public ActionResult ListofCompliance()
        {
            ViewBag.Message = TempData["Message"];
            ListofComplianceViewModel model = new ListofComplianceViewModel();
            int flag = 0;

            OrgService.OrganizationServiceClient organizationService = new OrgService.OrganizationServiceClient();
            string  strXMLCountries = organizationService.GetCountryList();
            DataSet dsCountries     = new DataSet();

            dsCountries.ReadXml(new StringReader(strXMLCountries));
            model.CountryList = new List <SelectListItem>();
            if (dsCountries.Tables.Count > 0)
            {
                model.countryid = Convert.ToInt32(dsCountries.Tables[0].Rows[0]["Country_ID"]);
                foreach (System.Data.DataRow row in dsCountries.Tables[0].Rows)
                {
                    model.CountryList.Add(new SelectListItem()
                    {
                        Text = row["Country_Name"].ToString(), Value = row["Country_ID"].ToString()
                    });
                }
            }
            string  strXMLIndustryType = organizationService.GetIndustryType();
            DataSet dsIndustryType     = new DataSet();

            dsIndustryType.ReadXml(new StringReader(strXMLIndustryType));
            model.IndustryTypeList = new List <SelectListItem>();
            model.IndustryTypeList.Add(new SelectListItem {
                Text = "-- Select Industry Type --", Value = "0"
            });
            if (dsIndustryType.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in dsIndustryType.Tables[0].Rows)
                {
                    model.IndustryTypeList.Add(new SelectListItem()
                    {
                        Text = row["Industry_Name"].ToString(), Value = row["Industry_Type_ID"].ToString()
                    });
                }
            }

            model.ComplianceTypeList = new List <SelectListItem>();
            model.ComplianceTypeList.Add(new SelectListItem {
                Text = "-- Select ComplianceType List --", Value = "0"
            });
            var countryid = Request.QueryString["countryid"];

            if (countryid != null)
            {
                model.countryid = Convert.ToInt32(countryid);
            }
            else
            {
                model.countryid = 1;
            }
            var audit = Request.QueryString["compliancetypeid"];

            if (audit != null)
            {
                model.compliancetypeid = Convert.ToInt32(audit);
            }
            else
            {
                model.compliancetypeid = 0;
            }

            ComplianceXrefService.ComplianceXrefServiceClient client = new ComplianceXrefService.ComplianceXrefServiceClient();

            string  xmldata = client.GetcomplianceonType(model.compliancetypeid, model.countryid, 0, 0, flag);
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            DataView dv = new DataView(ds.Tables[0]);

            dv.RowFilter = "level=1";
            dv.Sort      = "Last_Updated_Date desc";
            DataTable dt = dv.ToTable();

            dv           = new DataView(ds.Tables[0]);
            dv.RowFilter = "level=2";
            DataTable dtrules = dv.ToTable();

            if (dt.Rows.Count > 0)
            {
                model.Actslist = bindCompliancelist(dt);
                if (dtrules.Rows.Count > 0)
                {
                    model.Rulelist = bindCompliancelist(dtrules);
                }
            }
            return(View("_ListofCompliance", model));
        }