public static JsonFile UpdateJsonFile(long id = 0L, string filename = "") { JsonFile file = new JsonFile(); using (JsonStoreDataContext db = new JsonStoreDataContext()) { tbl_JsonFile jfile = (from pp in db.tbl_JsonFiles where id.Equals(0) || pp.ID.Equals(id) select pp).FirstOrDefault(); jfile.LastUpdateTime = DateTime.Now; file = file.Map(jfile); db.SubmitChanges(); } return(file); }
private JsonFile Map(tbl_JsonFile jfile) { if (jfile == null) { return(null); } this.ID = jfile.ID; this.Name = jfile.Name; this.CreationTime = Convert.ToDateTime(jfile.CreationTime); this.LastUpdateTime = Convert.ToDateTime(jfile.LastUpdateTime); this.Path = jfile.Path; this.Description = jfile.Description; this.Active = Convert.ToBoolean(jfile.Active); this.BackupOf = Convert.ToInt64(jfile.BackupOf); this.UserRoleID = Convert.ToInt64(jfile.UserRoleID); return(this); }
partial void Updatetbl_JsonFile(tbl_JsonFile instance);
partial void Deletetbl_JsonFile(tbl_JsonFile instance);
partial void Inserttbl_JsonFile(tbl_JsonFile instance);