public ActionResult Index() { var department = _departmentManager.GetAll(); var designation = _designationManager.GetAll(); var driver = _employeeManager.Get(c => c.IsDriver == true && c.IsDeleted == false); var division = _divisionManager.GetAll(); var district = _districtManager.GetAll(); var thana = _thanaManager.GetAll(); List <DriverViewModel> driverViewList = new List <DriverViewModel>(); foreach (var driverdata in driver) { var driverVm = new DriverViewModel(); driverVm.Id = driverdata.Id; driverVm.Name = driverdata.Name; driverVm.ContactNo = driverdata.ContactNo; driverVm.Email = driverdata.Email; driverVm.Address1 = driverdata.Address1; driverVm.Address2 = driverdata.Address2; driverVm.LicenceNo = driverdata.LicenceNo; driverVm.Department = department.Where(x => x.Id == driverdata.DepartmentId).FirstOrDefault(); driverVm.Designation = designation.Where(x => x.Id == driverdata.DesignationId).FirstOrDefault(); driverVm.Division = division.Where(x => x.Id == driverdata.DivisionId).FirstOrDefault(); driverVm.District = district.Where(x => x.Id == driverdata.DistrictId).FirstOrDefault(); driverVm.Thana = thana.Where(x => x.Id == driverdata.ThanaId).FirstOrDefault(); driverViewList.Add(driverVm); } return(View(driverViewList)); }
public ActionResult Index() { var department = _departmentManager.GetAll(); var designation = _designationManager.GetAll(); var employee = _employeeManager.Get(c => c.IsDriver == false && c.IsDeleted == false); var division = _divisionManager.GetAll(); var district = _districtManager.GetAll(); var thana = _thanaManager.GetAll(); List <EmployeeViewModel> employeeViewList = new List <EmployeeViewModel>(); foreach (var emploeedata in employee) { var employeeVM = new EmployeeViewModel(); employeeVM.Id = emploeedata.Id; employeeVM.Name = emploeedata.Name; employeeVM.ContactNo = emploeedata.ContactNo; employeeVM.Email = emploeedata.Email; employeeVM.Address1 = emploeedata.Address1; employeeVM.Address2 = emploeedata.Address2; employeeVM.LicenceNo = emploeedata.LicenceNo; employeeVM.Department = department.Where(x => x.Id == emploeedata.DepartmentId).FirstOrDefault(); employeeVM.Designation = designation.Where(x => x.Id == emploeedata.DesignationId).FirstOrDefault(); employeeVM.Division = division.Where(x => x.Id == emploeedata.DivisionId).FirstOrDefault(); employeeVM.District = district.Where(x => x.Id == emploeedata.DistrictId).FirstOrDefault(); employeeVM.Thana = thana.Where(x => x.Id == emploeedata.ThanaId).FirstOrDefault(); employeeViewList.Add(employeeVM); } return(View(employeeViewList)); }
// GET: Sales/Client/AddNewClient public ActionResult AddNewClient() { ViewBag.RegionId = new SelectList(_iRegionManager.GetAll(), "RegionId", "RegionName"); ViewBag.ClientTypeId = new SelectList(_iCommonManager.GetAllClientType(), "ClientTypeId", "ClientTypeName"); ViewBag.DistrictId = new SelectList(_iDistrictManager.GetAll().ToList(), "DistrictId", "DistrictName"); ViewBag.UpazillaId = new SelectList(new List <Upazilla>(), "UpazillaId", "UpzillaName"); ViewBag.PostOfficeId = new SelectList(new List <PostOffice>(), "PostOfficeId", "PostOfficeName"); ViewBag.TerritoryId = new SelectList(new List <Territory>(), "TerritoryId", "TerritoryName"); return(View()); }
// GET: Addresses/Create public ActionResult Create() { try { ViewBag.DistrictId = new SelectList(_districtManager.GetAll(), "Id", "Name"); //district ViewBag.DivisionId = new SelectList(_divisionManager.GetAll(), "Id", "Name"); //division ViewBag.UpazilaId = new SelectList(_upazilaManager.GetAll(), "Id", "Name"); //upazila return(View()); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "Addresses", "Create"))); } }
public ActionResult Index() { var district = _districtManager.GetAll(); var division = _divisionManager.GetAll(); List <DistrictViewModel> districtVM = new List <DistrictViewModel>(); foreach (var dist in district) { var districtList = new DistrictViewModel(); districtList.Id = dist.Id; districtList.Name = dist.Name; districtList.Division = division.Where(x => x.Id == dist.DivisionId).FirstOrDefault(); districtVM.Add(districtList); } return(View(districtVM)); }
public ActionResult Index() { var thana = _thanaManager.GetAll(); var district = _districtManager.GetAll(); List <ThanaViewModel> thanaViewModels = new List <ThanaViewModel>(); foreach (var allthana in thana) { var thanaVM = new ThanaViewModel(); thanaVM.Id = allthana.Id; thanaVM.Name = allthana.Name; thanaVM.District = district.Where(x => x.Id == allthana.DistrictId).FirstOrDefault(); thanaViewModels.Add(thanaVM); } return(View(thanaViewModels)); }
// GET: Sales/Client/AddNewClient public ActionResult AddNewClient() { try { int branchId = Convert.ToInt32(Session["BranchId"]); ViewBag.BranchId = new SelectList(_iBranchManager.GetAllBranches(), "BranchId", "BranchName", branchId); ViewBag.RegionId = new SelectList(_iRegionManager.GetAll(), "RegionId", "RegionName"); ViewBag.ClientTypeId = new SelectList(_iCommonManager.GetAllClientType(), "ClientTypeId", "ClientTypeName"); ViewBag.DistrictId = new SelectList(_iDistrictManager.GetAll().ToList(), "DistrictId", "DistrictName"); ViewBag.UpazillaId = new SelectList(new List <Upazilla>(), "UpazillaId", "UpzillaName"); ViewBag.PostOfficeId = new SelectList(new List <PostOffice>(), "PostOfficeId", "PostOfficeName"); ViewBag.TerritoryId = new SelectList(new List <Territory>(), "TerritoryId", "TerritoryName"); return(View()); } catch (Exception exception) { Log.WriteErrorLog(exception); return(PartialView("_ErrorPartial", exception)); } }