/// <summary> /// Adds Criminal Entity to the database /// </summary> /// <returns></returns> public bool AddToDatabase() { if (this._criminalInstance != null && IsValid) { try { if (PdfGenertor.GeneratorPdf(this)) { var dbContext = new NationalCriminalModelDataContext(); this._criminalInstance.Id = Guid.NewGuid(); dbContext.Criminals.InsertOnSubmit(this._criminalInstance); dbContext.SubmitChanges(); return(true); } } catch { } } return(false); }
/// <summary> /// Add Current instiated user instance which is data access entity to the data base /// </summary> /// <returns></returns> public bool AddToDataBase() { if (this._userInstance != null && IsValid) { try { this._userInstance.Id = Guid.NewGuid(); NationalCriminalModelDataContext dbContext = new NationalCriminalModelDataContext(); dbContext.Users.InsertOnSubmit(this._userInstance); dbContext.SubmitChanges(); return true; } catch { } } return false; }