public bool DeleteABSAMember(BSAMemberViewModel item) { //Connect to the Umbraco DB var db = new PetaPoco.Database(sConnectString); BSAMember oModel = new BSAMember(); oModel.BSAMemberId = item.BSAMemberId; oModel.BSAMemberType = item.BSAMemberType; oModel.FirstName = item.FirstName; oModel.LastName = item.LastName; oModel.StreetAddress = item.StreetAddress; oModel.City = item.City; oModel.State = item.State; oModel.ZipCode = item.ZipCode; oModel.District = item.District; oModel.Council = item.Council; oModel.Troop = item.Troop; oModel.Crew = item.Crew; oModel.Telephone = item.Telephone; oModel.BirthDate = item.BirthDate; oModel.EmailAddress = item.EmailAddress; oModel.ScoutMasterId = item.ScoutMasterId; oModel.BackGroundCheck = item.BackGroundCheck; oModel.DeleteRecordFlag = true; db.Update(oModel); //Return the view with our model and comments return(true); }
private BSAMemberViewModel FillViewModelBSAMember(BSAMember item, bool includePassword) { BSAMemberViewModel oModel = new BSAMemberViewModel(); oModel.BSAMemberId = item.BSAMemberId; oModel.BSAMemberType = item.BSAMemberType; oModel.UserName = item.UserName; if (includePassword == true) { oModel.Password = item.Password; } oModel.FirstName = item.FirstName; oModel.LastName = item.LastName; oModel.StreetAddress = item.StreetAddress; oModel.City = item.City; oModel.State = item.State; oModel.ZipCode = item.ZipCode; oModel.District = item.District; oModel.Council = item.Council; oModel.Troop = item.Troop; oModel.Crew = item.Crew; oModel.Telephone = item.Telephone; oModel.BirthDate = item.BirthDate; oModel.EmailAddress = item.EmailAddress; oModel.ScoutMasterId = item.ScoutMasterId; oModel.BackGroundCheck = item.BackGroundCheck; return(oModel); }
private int SaveABSAMemberRecord(BSAMemberViewModel item) { //Connect to the Umbraco DB var db = new PetaPoco.Database(sConnectString); BSAMember oModel = new BSAMember(); oModel.BSAMemberId = item.BSAMemberId; oModel.UserName = item.UserName; oModel.Password = item.Password; oModel.BSAMemberType = item.BSAMemberType; oModel.FirstName = item.FirstName; oModel.LastName = item.LastName; oModel.StreetAddress = item.StreetAddress; oModel.City = item.City; oModel.State = item.State; oModel.ZipCode = item.ZipCode; oModel.District = item.District; oModel.Council = item.Council; oModel.Troop = item.Troop; oModel.Crew = item.Crew; oModel.ScoutMasterId = item.ScoutMasterId; oModel.Telephone = item.Telephone; oModel.BirthDate = item.BirthDate; oModel.EmailAddress = item.EmailAddress; oModel.BackGroundCheck = item.BackGroundCheck; oModel.DeleteRecordFlag = false; if (item.BSAMemberId > 0) { db.Update(oModel); } else { db.Insert(oModel); } //Return the view with our model and comments return(oModel.BSAMemberId); }