// GET: JJDManagement/Entity public ActionResult Index(int pageIndex = 1, string keyword = "", G_EntityDTO entity = default(G_EntityDTO)) { const int pageSize = 50; entity = new G_EntityDTO(); var result = this._IG_EntityService.GetAll(pageIndex, pageSize, keyword, entity.Province, entity.City, entity.Country); return(View(result)); }
public ActionResult Create(G_EntityDTO entity) { if (ModelState.IsValid) { this._IG_EntityService.Create(entity); return(RedirectToAction("index")); } ViewBag.error = ModelState.GetErrorMsg(); return(View()); }
public ActionResult Edit(G_EntityDTO entity) { if (ModelState.IsValid) { this._IG_EntityService.Update(new List <G_EntityDTO> { entity }); return(RedirectToAction("index")); } ViewBag.error = ModelState.GetErrorMsg(); return(View()); }
public G_EntityDTO Create(G_EntityDTO dto) { //int count = this._IG_EntityRepository.Data.SafeMax(item => int.Parse(item.Code)); string code = this._IG_EntityRepository.GetMaxCode(); if (string.IsNullOrWhiteSpace(code)) { code = "1000"; } else { code = (int.Parse(code) + 1).ToString(); } dto.Code = code; return(base.F_Create <G_EntityDTO, G_Entity>(dto , _IG_EntityRepository , dtoAction => { })); }