Ejemplo n.º 1
0
        public ActionResult AssignRules(string branchid, string vendorid, string vendorname)
        {
            AllocateActandRuleViewModel model = new AllocateActandRuleViewModel();

            model.ActType = new List <SelectListItem>();
            model.ActType.Add(new SelectListItem {
                Text = "Union and State Level", Value = "0"
            });
            model.ActType.Add(new SelectListItem {
                Text = "Union Level", Value = "1"
            });
            model.ActType.Add(new SelectListItem {
                Text = "State Level", Value = "2"
            });

            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            string  xmldata          = client.GetAssignedComplianceTypes(Convert.ToInt32(vendorid));
            DataSet ds               = new DataSet();
            DataSet dscompliancetype = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            int[] compliancetypeid = new int[ds.Tables[0].Rows.Count];
            int   i = 0;

            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    compliancetypeid[i++] = Convert.ToInt32(row["Compliance_Type_ID"]);
                }
            }
            model.AuditType = new List <SelectListItem>();
            ComplianceXrefService.ComplianceXrefServiceClient serviceClient = new ComplianceXrefService.ComplianceXrefServiceClient();
            for (i = 0; i < compliancetypeid.Length; i++)
            {
                xmldata = serviceClient.GetComplainceType(compliancetypeid[i]);
                ds      = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                if (ds.Tables.Count > 0)
                {
                    model.AuditTypeID = Convert.ToInt32(ds.Tables[0].Rows[0]["Compliance_Type_ID"]);
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.AuditType.Add(new SelectListItem {
                            Text = Convert.ToString(row["Compliance_Type_Name"]), Value = Convert.ToString(row["Compliance_Type_ID"])
                        });
                    }
                }
            }

            model.BranchId        = Convert.ToInt32(branchid);
            model.Name            = vendorname;
            Session["Branch_Id"]  = branchid;
            Session["BranchName"] = vendorname;
            Session["VendorId"]   = vendorid;
            return(View("_AssignRules", model));
        }
Ejemplo n.º 2
0
        public ActionResult selectauditfrequency(int branchid, int vendorid, string vendorname)
        {
            Compliancetype_view_model model = new Compliancetype_view_model();

            model.compliance_Types = new List <compliance_type>();
            model.branchid         = branchid;
            model.vendorid         = vendorid;
            model.vendorname       = vendorname;
            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            string  xmldata          = client.GetAssignedComplianceTypes(vendorid);
            DataSet ds               = new DataSet();
            DataSet dscompliancetype = new DataSet();

            ds.ReadXml(new StringReader(xmldata));
            int[] compliancetypeid = new int[ds.Tables[0].Rows.Count];
            int   i = 0;

            if (ds.Tables.Count > 0)
            {
                foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                {
                    compliancetypeid[i++] = Convert.ToInt32(row["Compliance_Type_ID"]);
                }
            }

            ComplianceXrefService.ComplianceXrefServiceClient serviceClient = new ComplianceXrefService.ComplianceXrefServiceClient();
            for (i = 0; i < compliancetypeid.Length; i++)
            {
                xmldata = serviceClient.GetComplainceType(compliancetypeid[i]);
                ds      = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                if (ds.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.compliance_Types.Add(new compliance_type
                        {
                            complianceid   = Convert.ToInt32(row["Compliance_Type_ID"]),
                            auditfrequency = Convert.ToInt32(row["Audit_Frequency"]),
                            Name           = Convert.ToString(row["Compliance_Type_Name"]),
                            startdate      = Convert.ToDateTime(row["Start_Date"]),
                            enddate        = Convert.ToDateTime(row["End_Date"])
                        });
                    }
                }
            }



            return(View("_SelectFrequency", model));
        }
        public JsonResult getcompliancelistundercompany(string compid)
        {
            List <SelectListItem> cities = new List <SelectListItem>();
            int CID = Convert.ToInt32(compid);

            OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient();
            string  strXMLCompliances = organizationservice.GetAssignedComplianceTypes(CID);
            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));
        }
Ejemplo n.º 4
0
        public ActionResult selectbranch()
        {
            AuditorpageViewModel model = new AuditorpageViewModel();

            model.companyList     = new List <SelectListItem>();
            model.BranchList      = new List <SelectListItem>();
            model.VendorList      = new List <Organization>();
            model.CompliancceType = new List <SelectListItem>();

            OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient();
            int groupid = Convert.ToInt32(Session["GroupCompanyId"]);

            if (groupid != 0)
            {
                string  xmldata = client.getCompanyListDropDown(groupid);
                DataSet ds      = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                model.companyList = new List <SelectListItem>();
                if (ds.Tables.Count > 0)
                {
                    model.companyid = Convert.ToInt32(ds.Tables[0].Rows[0]["Org_Hier_ID"]);
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.companyList.Add(new SelectListItem {
                            Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                        });
                    }
                }

                xmldata = client.GetAssignedComplianceTypes(model.companyid);
                ds      = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                if (ds.Tables.Count > 0)
                {
                    model.ComplianceTypeid = Convert.ToInt32(ds.Tables[0].Rows[0][""]);
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.CompliancceType.Add(new SelectListItem {
                            Text = Convert.ToString(row["Compliance_Type_Name"]), Value = Convert.ToString(row["Compliance_Type_ID"])
                        });
                    }
                }

                model.BranchList = new List <SelectListItem>();
                xmldata          = client.GeSpecifictBranchList(model.companyid);
                ds = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                if (ds.Tables.Count > 0)
                {
                    model.branchid = Convert.ToInt32(ds.Tables[0].Rows[0]["Org_Hier_ID"]);
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.BranchList.Add(new SelectListItem {
                            Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"])
                        });
                    }
                }

                VendorService.VendorServiceClient vendorServiceClient = new VendorService.VendorServiceClient();
                xmldata = vendorServiceClient.GetAssignedVendorsforBranch(model.branchid);
                ds      = new DataSet();
                ds.ReadXml(new StringReader(xmldata));
                if (ds.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow row in ds.Tables[0].Rows)
                    {
                        model.VendorList.Add(new Organization {
                            Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Vendor_ID"]), logo = Convert.ToString(row["logo"])
                        });
                    }
                }
                else
                {
                    TempData["Message"] = "No Vendors assigned for the selected branch.";
                }
            }
            else
            {
                ModelState.AddModelError("", ConfigurationManager.AppSettings["SelectGroupCompany"]);
            }

            return(View("_SelectBranch", model));
        }