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 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 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));
        }
示例#4
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));
        }