public ActionResult AssignRules(string Branchid, string Vendorid, string Branchname) { 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" }); model.AuditType = new List <SelectListItem>(); model.AuditType.Add(new SelectListItem { Text = "Labour Compliance", Value = "1" }); model.BranchId = Convert.ToInt32(Branchid); model.Name = Branchname; Session["Branch_Id"] = Branchid; Session["BranchName"] = Branchname; Session["VendorId"] = Vendorid; return(View("_AssignRules", model)); }
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)); }
public ActionResult SMEdashboard(AllocateActandRuleViewModel model) { model.Companylist = new List <SelectListItem>(); OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient(); int groupid = Convert.ToInt32(Session["GroupCompanyId"]); string xmldata = client.getCompanyListDropDown(groupid); DataSet ds = new DataSet(); ds.ReadXml(new StringReader(xmldata)); model.Companylist = new List <SelectListItem>() { new SelectListItem { Text = "--Select Company--", Value = "0" } }; if (ds.Tables.Count > 0) { 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"]) }); } } model.Branch = new List <Organization>(); xmldata = client.GeSpecifictBranchList(model.CompanyId); ds = new DataSet(); ds.ReadXml(new StringReader(xmldata)); if (ds.Tables.Count > 0) { foreach (System.Data.DataRow row in ds.Tables[0].Rows) { model.Branch.Add(new Organization { Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Org_Hier_ID"]) }); //model.BranchList.Add(new SelectListItem { Text = Convert.ToString(row["Company_Name"]), Value = Convert.ToString(row["Org_Hier_ID"]) }); } } return(View("_SMEDashboard", model)); }
public ActionResult Listofvendors(int branchid) { AllocateActandRuleViewModel model = new AllocateActandRuleViewModel(); model.BranchId = branchid; model.Branch = new List <Organization>(); OrgService.OrganizationServiceClient service = new OrgService.OrganizationServiceClient(); string xmldata = service.getBranch(model.BranchId); DataSet data = new DataSet(); data.ReadXml(new StringReader(xmldata)); model.Branch.Add(new Organization { Company_Id = Convert.ToInt32(data.Tables[0].Rows[0]["Org_Hier_ID"]), Company_Name = Convert.ToString(data.Tables[0].Rows[0]["Company_Name"]), Parent_Company_Id = Convert.ToInt32(data.Tables[0].Rows[0]["Parent_Company_ID"]), logo = Convert.ToString(data.Tables[0].Rows[0]["logo"]) }); model.Vendor = new List <Organization>(); VendorService.VendorServiceClient vendorServiceClient = new VendorService.VendorServiceClient(); xmldata = vendorServiceClient.GetAssignedVendorsforBranch(branchid); DataSet ds = new DataSet(); ds.ReadXml(new StringReader(xmldata)); if (ds.Tables.Count > 0) { foreach (System.Data.DataRow row in ds.Tables[0].Rows) { model.Vendor.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."; } return(View("_Listofvendorforauditing", model)); }
public ActionResult SMEdashboard() { AllocateActandRuleViewModel model = new AllocateActandRuleViewModel(); OrgService.OrganizationServiceClient client = new OrgService.OrganizationServiceClient(); int groupid = Convert.ToInt32(Session["GroupCompanyId"]); string xmldata = client.getCompanyListDropDown(groupid); DataSet ds = new DataSet(); ds.ReadXml(new StringReader(xmldata)); model.Companylist = new List <SelectListItem>() { new SelectListItem { Text = "--Select Company--", Value = "0" } }; 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"]) }); } } model.Branch = new List <Organization>(); OrgService.OrganizationServiceClient organizationservice = new OrgService.OrganizationServiceClient(); string strxmlCompanies = organizationservice.GeSpecifictBranchList(model.CompanyId); DataSet dsSpecificBranchList = new DataSet(); dsSpecificBranchList.ReadXml(new StringReader(strxmlCompanies)); if (dsSpecificBranchList.Tables.Count > 0) { foreach (System.Data.DataRow row in dsSpecificBranchList.Tables[0].Rows) { model.Branch.Add(new Organization { Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Org_Hier_ID"]) }); } } else { ViewBag.Message = ConfigurationManager.AppSettings["No_Branches"]; } //model.Vendor = new List<Organization>(); //xmldata = organizationservice.GetVendors(model.CompanyId); //ds = new DataSet(); //ds.ReadXml(new StringReader(xmldata)); //if (ds.Tables.Count > 0) //{ // foreach (System.Data.DataRow row in ds.Tables[0].Rows) // { // model.Vendor.Add(new Organization { Company_Name = Convert.ToString(row["Company_Name"]), Company_Id = Convert.ToInt32(row["Org_Hier_ID"]) }); // } //} return(View("_SMEDashboard", model)); }