public ActionResult Create2(int[] fieldid, Models.GapJournalHarvest collection) { try { if (fieldid.Count() == 0) { throw new Exception("Phải chọn thửa đất"); } var _dataobject2 = new DAL.GapField(Request); var _dataobject3 = new DAL.GapJournal(Request); foreach (var item in fieldid) { //_dataobject.MapView2Table(); var gapfield = _dataobject2.GetEdit(item); if (gapfield.RefJournalId != null) { var gapjournal = _dataobject3.GetById2(gapfield.RefJournalId.Value); if (gapjournal.IsolationDateEnd() > DateTime.Today) { continue; } collection.JournalId = gapjournal.JournalId; collection.RefIsolationDate = gapjournal.IsolationDate; collection.RefIsolationDay = gapjournal.IsolationDay; int outputId = _dataobject.Insert(collection); } } return(RedirectToAction(this.ActionReturn())); } catch (Exception ex) { ViewBag.fieldid = fieldid; Services.GlobalErrors.Parse(ModelState, _dataobject.Errors, ex); return(PartialView(collection)); } }
public ActionResult AutoComplete() { DAL.GapJournal _dataobject = new DAL.GapJournal(Request); return(Json(_dataobject.AutoComplete(), JsonRequestBehavior.AllowGet)); }
public ActionResult FieldChange() { DAL.GapJournal _dataobject = new DAL.GapJournal(Request); return(Json(_dataobject.FieldChange(), JsonRequestBehavior.AllowGet)); }
protected override IActionInvoker CreateActionInvoker() { _dataobject = new DAL.GapJournal(Request); this.InitData(_dataobject); return(base.CreateActionInvoker()); }