public JsonResult ListPhuongByName(string name) { var listAllPhuong = new PhuongDAO().ListAll(); var listResult = new List <List <string> >(); name = name.ToUpper(); string convert = "ĂÂÀẰẦÁẮẤẢẲẨÃẴẪẠẶẬỄẼỂẺÉÊÈỀẾẸỆÔÒỒƠỜÓỐỚỎỔỞÕỖỠỌỘỢƯÚÙỨỪỦỬŨỮỤỰÌÍỈĨỊỲÝỶỸỴĐăâàằầáắấảẳẩãẵẫạặậễẽểẻéêèềếẹệôòồơờóốớỏổởõỗỡọộợưúùứừủửũữụựìíỉĩịỳýỷỹỵđ"; string To = "AAAAAAAAAAAAAAAAAEEEEEEEEEEEOOOOOOOOOOOOOOOOOUUUUUUUUUUUIIIIIYYYYYDaaaaaaaaaaaaaaaaaeeeeeeeeeeeooooooooooooooooouuuuuuuuuuuiiiiiyyyyyd"; for (int i = 0; i < To.Length; i++) { name = name.Replace(convert[i], To[i]); } foreach (var item in listAllPhuong) { for (int i = 0; i < To.Length; i++) { item.TenPhuong = item.TenPhuong.Replace(convert[i], To[i]); } foreach (var phuong in listAllPhuong) { if (phuong.idPhuong == item.idPhuong) { listResult.Add(new List <string> { phuong.idPhuong.ToString(), phuong.TenPhuong }); } } } return(Json(listResult, JsonRequestBehavior.AllowGet)); }
public JsonResult ListPhuongByID(int id) { var listPhuong = new PhuongDAO().GetListByID(id); return(Json(listPhuong, JsonRequestBehavior.AllowGet)); }
public JsonResult ListAllPhuong() { var listPhuong = new PhuongDAO().ListAll(); return(Json(listPhuong, JsonRequestBehavior.AllowGet)); }