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));
        }
Example #2
0
        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));
        }
 // 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")));
     }
 }
Example #4
0
        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 Division = _divisionManager.GetAll();

            return(View(Division));
        }