Esempio n. 1
0
        public ActionResult ListofCompliance()
        {
            ViewBag.Message = TempData["Message"];
            ListofComplianceViewModel model = new ListofComplianceViewModel();

            ComplianceXrefService.ComplianceXrefServiceClient client = new ComplianceXrefService.ComplianceXrefServiceClient();
            //string xmlcompliance = client.GetComplaince(0);
            //DataSet dscompliance = new DataSet();
            //dscompliance.ReadXml(new StringReader (xmlcompliance));
            //DataView dv = new DataView(dscompliance.Tables[0]);
            //dv.RowFilter = "level=1";
            string  xmldata = client.GetActs(0);
            DataSet ds      = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            if (ds.Tables.Count > 0)
            {
                model.Actslist = bindCompliancelist(ds.Tables[0], model.Actslist);

                //xmldata = client.GetSections(0);
                //ds = new DataSet();
                //ds.ReadXml(new StringReader(xmldata));
                //if (ds.Tables.Count > 0)
                //{
                //  model.Sectionlist = bindCompliancelist(ds.Tables[0], model.Sectionlist);

                xmldata = client.GetRules(0);
                ds      = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                if (ds.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.Rulelist.Add(new ComplianceXref
                        {
                            Compliance_Xref_ID    = Convert.ToInt32(row["Compliance_Xref_ID"]),
                            Compliance_Parent_ID  = Convert.ToInt32(row["Compliance_Parent_ID"]),
                            Compliance_Title      = Convert.ToString(row["Compliance_Title"]),
                            Comp_Category         = Convert.ToString(row["Comp_Category"]),
                            Comp_Description      = Convert.ToString(row["Comp_Description"]),
                            compl_def_consequence = Convert.ToString(row["compl_def_consequence"]),
                            Comp_Order            = Convert.ToInt32(row["Comp_Order"]),
                            Country_ID            = Convert.ToInt32(row["Country_ID"]),
                            City_ID              = Convert.ToInt32(row["City_ID"]),
                            Effective_End_Date   = Convert.ToDateTime(row["Effective_Start_Date"]),
                            Effective_Start_Date = Convert.ToDateTime(row["Effective_End_Date"]),
                            Form              = Convert.ToString(row["Form"]),
                            Is_Header         = Convert.ToBoolean(Convert.ToInt32(row["Is_Header"])),
                            level             = Convert.ToInt32(row["level"]),
                            State_ID          = Convert.ToInt32(row["State_ID"]),
                            User_ID           = Convert.ToInt32(row["User_ID"]),
                            Is_Active         = Convert.ToBoolean(Convert.ToInt32(row["Is_Active"])),
                            Is_Best_Practice  = Convert.ToBoolean(Convert.ToInt32(row["Is_Best_Practice"])),
                            Risk_Category     = Convert.ToString(row["Risk_Category"]),
                            Last_Updated_Date = Convert.ToDateTime(row["Last_Updated_Date"]),
                            Recurrence        = Convert.ToString(row["Recurrence"]),
                            Risk_Description  = Convert.ToString(row["Risk_Description"]),
                            Type              = Convert.ToString(row["Type"]),
                            Version           = Convert.ToInt32(row["Version"])
                        });
                    }
                }
                //}
            }
            return(View("_ListofCompliance", model));
        }
Esempio n. 2
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));
        }