public ActionResult ShowAllbydbid(int[] rsMid, int[] asMid, int[] cEid, int[] id) { Supporting sp = new Supporting(); HashSet <int> dbids = sp.Alldbids(rsMid, asMid, cEid, id); var data = from a in Db.tbld_distributor_Route join b in Db.status on a.IsActive equals b.status_Id join c in Db.tbld_distributor_Route on a.ParentID equals c.RouteID into routeparent from parent in routeparent.DefaultIfEmpty() join d in Db.tbld_distribution_house on a.DistributorID equals d.DB_Id join e in Db.tbld_distributor_RouteType on a.RouteType equals e.RouteType where dbids.Contains(a.DistributorID) orderby a.IsActive select new DBhouseRouteiVm { RouteId = a.RouteID, RouteCode = a.RouteCode, RouteName = a.RouteName, RouteType = e.RouteTypeCode, IsActive = b.status_code, Distributor = d.DBName, Parent = parent.RouteName }; return(PartialView(data.ToList())); }
public HashSet <int> Alldbids(int[] rsMid, int[] asMid, int[] cEid, int[] id) { HashSet <int> dbids; Supporting sp = new Supporting(); if (id != null) { dbids = new HashSet <int>(id); } else if (cEid != null) { dbids = sp.GetdbidsbyCe(cEid); } else if (asMid != null) { dbids = sp.GetdbidsbyTdm(asMid); } else if (rsMid != null) { dbids = sp.GetdbidsbyRsm(rsMid); } else { dbids = sp.GetdbidsbyNsm(); } return(dbids); }
public ActionResult ShowAllbydbid(int[] rsMid, int[] asMid, int[] cEid, int[] id) { Supporting sp = new Supporting(); HashSet <int> dbids = sp.Alldbids(rsMid, asMid, cEid, id); var data = from a in Db.tbld_distribution_employee join b in Db.tbld_distribution_employee_Type on a.Emp_Type equals b.EmpTypeid join c in Db.tbld_distribution_house on a.DistributionId equals c.DB_Id join d in Db.status on a.active equals d.status_Id where dbids.Contains(c.DB_Id) select new DBhouseemployeeiVm { Id = a.id, EmpCode = a.Emp_code, Name = a.Name, Distribution = c.DBName, EmpType = b.EmpType, LoginUserId = a.login_user_id, Active = d.status_code }; return(PartialView(data.ToList())); }
public ActionResult ApproveOutletShowAllbydbid(int[] rsMid, int[] asMid, int[] cEid, int[] id) { Supporting sp = new Supporting(); HashSet <int> dbids = sp.Alldbids(rsMid, asMid, cEid, id); var data = from a in Db.tbld_Outlet_new join b in Db.tbld_distribution_house on a.Distributorid equals b.DB_Id into dbHouse from dBhouse in dbHouse.DefaultIfEmpty() join c in Db.tbld_distributor_Route on a.parentid equals c.RouteID into dbRoute from route in dbRoute.DefaultIfEmpty() join e in Db.tbld_Outlet_category on a.outlet_category_id equals e.id into dboutletCategory from outletCategory in dboutletCategory.DefaultIfEmpty() join f in Db.tbld_Outlet_grade on a.grading equals f.id into outletGrading from grading in outletGrading.DefaultIfEmpty() join g in Db.tbld_Outlet_channel on a.channel equals g.id into outletChannel from channel in outletChannel.DefaultIfEmpty() where dbids.Contains(a.Distributorid) && a.verify_status == 0 orderby a.Id, a.parentid select new DBhouseoutletiVm { OutletId = a.Id, OutletCode = a.OutletCode, OutletName = a.OutletName, OutletNameB = a.OutletName_b, Location = a.Location, Address = a.Address, GpsLocation = a.GpsLocation, OwnerName = a.OwnerName, ContactNo = a.ContactNo, Distributor = dBhouse.DBName, HaveVisicooler = a.HaveVisicooler == 1 ? "YES" : "NO", Parentid = route.RouteName, Category = outletCategory.outlet_category_name, Grading = grading.name, Channel = channel.name, Latitude = a.Latitude, Longitude = a.Longitude, Picture = a.picture, IsActive = a.IsActive == 1 ? "Active" : "Inactive", Createdate = a.createdate }; return(PartialView(data.ToList())); }