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));
        }
        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);
        }
Beispiel #3
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));
        }
Beispiel #4
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));
        }