public bool SaveToDB() { //... Finish coding property assignments. var ttst = new ENJobExchange.DAL.Referral() { EN_Notes = ENNotes, ENID = this.ENID, Name_First = this.Name_First, Name_Last = this.Name_Last }; try { if (this.ReferralID == 0) { db.Referrals.Add(ttst); db.SaveChanges(); //... Get new ReferralID and set this.ReferralID return(true); } else { //... code to update existing Referral record. return(true); } } catch { return(false); } }
public bool SaveToDB() { //... Finish coding property assignments. var ttst = new ENJobExchange.DAL.Referral() { Referral_DT = System.DateTime.Now, JobPostingID = this.JobPostingID, Account_ENID = 2, ENID = 3, Name_First = this.Name_First, Name_Last = this.Name_Last, ReferralTypeID = 1, ReferralStatusID = 1, EN_Notes = this.EN_Notes, File_CoverLetter = "", File_Resume = "", ConfirmationNumber = this.ConfirmationNumber }; try { if (this.ReferralID == 0) { db.Referrals.Add(ttst); db.SaveChanges(); this.ReferralID = ttst.ReferralID; //... Get new ReferralID and set this.ReferralID return(true); } else { //... code to update existing Referral record. return(true); } } catch (Exception ex1) { return(false); } }
public bool SaveToDB() { //... Finish coding property assignments. var ttst = new ENJobExchange.DAL.Referral() { EN_Notes = ENNotes, ENID = this.ENID, Name_First = this.Name_First, Name_Last = this.Name_Last }; try { if (this.ReferralID == 0) { db.Referrals.Add(ttst); db.SaveChanges(); //... Get new ReferralID and set this.ReferralID return true; } else { //... code to update existing Referral record. return true; } } catch { return false; } }
public bool SaveToDB() { //... Finish coding property assignments. var ttst = new ENJobExchange.DAL.Referral() { Referral_DT = System.DateTime.Now, JobPostingID = this.JobPostingID, Account_ENID = 2, ENID = 3, Name_First = this.Name_First, Name_Last = this.Name_Last, ReferralTypeID = 1, ReferralStatusID = 1, EN_Notes = this.EN_Notes, File_CoverLetter = "", File_Resume = "", ConfirmationNumber = this.ConfirmationNumber }; try { if (this.ReferralID == 0) { db.Referrals.Add(ttst); db.SaveChanges(); this.ReferralID = ttst.ReferralID; //... Get new ReferralID and set this.ReferralID return true; } else { //... code to update existing Referral record. return true; } } catch (Exception ex1) { return false; } }