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); }
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 ActionResult IndustryTypeMapwithCompliance(ComplianceIndustryViewModel model) { OrgService.OrganizationServiceClient organizationService = new OrgService.OrganizationServiceClient(); int id = organizationService.insertComplianceTypesMappedWithIndustryType(model.ComplianceType, model.IndustryType); return View(""); }