public void Destroy(BeneficiariesViewModel db)
        {
            var entity = new Beneficiaries_Table();

            entity.Beneficiaries_ID = db.Beneficiaries_ID;

            entities.Beneficiaries_Table.Attach(entity);

            entities.Beneficiaries_Table.Remove(entity);

            entities.SaveChanges();
        }
        public void Update(BeneficiariesViewModel db)
        {
            var entity = new Beneficiaries_Table();

            entity.Beneficiaries_ID      = db.Beneficiaries_ID;
            entity.BeneficiariesIDNumber = db.BeneficiariesIDNumber;

            entity.BeneficiariesName = db.BeneficiariesName;

            entity.BeneficiariesPhone = db.BeneficiariesPhone;
            entity.GenderID           = db.GenderID;
            entities.Beneficiaries_Table.Attach(entity);

            entities.Entry(entity).State = EntityState.Modified;
            entities.SaveChanges();
        }
        public void Create(BeneficiariesViewModel db)
        {
            var entity = new Beneficiaries_Table();

            entity.BeneficiariesIDNumber = db.BeneficiariesIDNumber;

            entity.BeneficiariesName = db.BeneficiariesName;

            entity.BeneficiariesPhone = db.BeneficiariesPhone;
            entity.GenderID           = db.GenderID;

            entities.Beneficiaries_Table.Add(entity);
            entities.SaveChanges();

            db.Beneficiaries_ID = entity.Beneficiaries_ID;
        }