public string DeleteNotesInfofromRowId(int rowid) { notesinformation ni = ss.notesinformations.Where(n => n.rowid == rowid).Single(); if (ni.rowid > 0) { ss.notesinformations.Remove(ni); ss.SaveChanges(); return("successfully"); } else { return("record not found"); } }
///update notesinformation set notes ='' , Title='' where rowid=''; public bool getNotesInfoByEno(int rowid, string notes, string title) { notesinformation ni = ss.notesinformations.Where(n => n.rowid == rowid).Single(); if (ni.rowid > 0) { ni.notes = notes; ni.Title = title; ss.SaveChanges(); return(true); } else { return(false); } }
public string insertNotesInformation(string eno, string notes, string title) { try { notesinformation ni = new notesinformation(); ni.Enno = eno; ni.Title = title; ni.notes = notes; ni.date = DateTime.Now.Date.ToShortDateString(); ss.notesinformations.Add(ni); ss.SaveChanges(); return("successfully"); } catch (Exception ex) { return("failed"); } }