Пример #1
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));
        }
        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);
        }
Пример #3
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));
        }
Пример #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));
        }
Пример #5
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));
        }