public ActionResult EditBanDo(int id) { try { CMS_Maps_DAO objDAO = new CMS_Maps_DAO(); DT_WebGISEntities MyContext = new DT_WebGISEntities(); CMS_MapService_DAO objMapSeveDAO = new CMS_MapService_DAO(); CMS_Services_DAO objSeverDAO = new CMS_Services_DAO(); var Partial = objDAO.GetMapByID(id); var list = MyContext.CMS_TypeOfMap.ToList(); TempData["TypeOfMap"] = new SelectList(list, "ID", "Name", (int)Partial.TypeOfMapID); TempData.Keep("TypeOfMap"); var list1 = MyContext.CMS_MapService_ByMapID(id).ToList(); TempData["MapServices"] = list1.ToList(); TempData.Keep("MapServices"); var list2 = MyContext.CMS_Services.Where(s => s.Publish == true).ToList(); TempData["Services"] = list2; TempData.Keep("Services"); return(View(Partial)); } catch (Exception ex) { SetAlert("Lỗi" + ex.Message.ToString(), AlertType.Error); Logs.WriteLog(ex); return(View()); } }
public List <CMS_MapService_ByMapID_Result> ByMapID(int MapID) { try { List <CMS_MapService_ByMapID_Result> lData = MyContext.CMS_MapService_ByMapID(MapID).ToList(); return(lData); } catch (Exception ex) { Logs.WriteLog(ex); throw; } }