public ActionResult Delete(int id) { Student student = studentManager.GetSingleRow(id); ViewBag.Id = student.Id; ViewBag.Name = student.Name; ViewBag.DepartmentId = student.DepartmentId; DepartmentManager departmentManager = new DepartmentManager(); List <Department> singleDepartment = departmentManager.GetSingleRow(ViewBag.DepartmentId); foreach (var department in singleDepartment) { ViewBag.Department = department.Name; } Devision devision = new DevisionManager().GetSingleDivision(student.DivisionId); ViewBag.Division = devision.Name; District district = new DistrictManager().GetSinlgleDistrict(student.DistrictId); ViewBag.District = district.Name; Thana thana = new ThanaManager().GetSingleThana(student.ThanaId); ViewBag.Thana = thana.Name; return(View()); }
public ActionResult Details(int id) { var student = studentManager.GetSingleRow(id); ViewBag.Id = student.Id; ViewBag.Name = student.Name; ViewBag.DepartmentId = student.DepartmentId; var departmentManager = new DepartmentManager(); ViewBag.Department = departmentManager.GetSingleRow(ViewBag.DepartmentId); Devision devision = new DevisionManager().GetSingleDivision(student.DivisionId); ViewBag.Division = devision.Name; District district = new DistrictManager().GetSinlgleDistrict(student.DistrictId); ViewBag.District = district.Name; Thana thana = new ThanaManager().GetSingleThana(student.ThanaId); ViewBag.Thana = thana.Name; return(View()); }
public string GetAllThanaByDistrict(string district) { ThanaManager thanaManager = new ThanaManager(); List <Thana> thanas = thanaManager.GetAllByDistrict(Convert.ToInt16(district)); string thanasJson = JsonConvert.SerializeObject(thanas); return(thanasJson); }
public ActionResult Edit(int id) { var student = studentManager.GetSingleRow(id); ViewBag.Id = student.Id; ViewBag.Name = student.Name; ViewBag.DepartmentId = student.DepartmentId; var departmentManager = new DepartmentManager(); ViewBag.Departments = departmentManager.GetAll(); List <Department> department = departmentManager.GetSingleRow(Convert.ToInt32(student.DepartmentId)); foreach (var dept in department) { ViewBag.Department = dept.Name; } List <Devision> devisions = new DevisionManager().GetAll(); ViewBag.Divisions = devisions; Devision devision = new DevisionManager().GetSingleDivision(student.DivisionId); ViewBag.DivisionId = devision.Id; ViewBag.Division = devision.Name; District district = new DistrictManager().GetSinlgleDistrict(student.DistrictId); ViewBag.DistrictId = district.Id; ViewBag.District = district.Name; Thana thana = new ThanaManager().GetSingleThana(student.ThanaId); ViewBag.ThanaId = thana.Id; ViewBag.Thana = thana.Name; return(View()); }