public bool Update(ReportModel model) { try { tbl_Daily tbl = new tbl_Daily(); tbl = db.tbl_Daily.Find(model.Id); tbl.Date = model.Date; db.SaveChanges(); return(true); } catch { return(false); } }
public bool Delete(int ma) { try { tbl_Daily tbl = new tbl_Daily(); tbl = db.tbl_Daily.Find(ma); db.tbl_Daily.Remove(tbl); db.SaveChanges(); return(true); } catch { return(false); } }
public bool Save(ReportModel model) { try { tbl_Daily tbl = new tbl_Daily(); tbl.Date = model.Date; tbl.UserName = HttpContext.Current.User.Identity.Name; db.tbl_Daily.Add(tbl); db.SaveChanges(); return(true); } catch { return(false); } }