Esempio n. 1
0
        public void Destroy(LawyerViewModel db)
        {
            var entity = new Lawyer_Table();

            entity.LawyerID = db.LawyerID;

            entities.Lawyer_Table.Attach(entity);

            entities.Lawyer_Table.Remove(entity);

            entities.SaveChanges();
        }
Esempio n. 2
0
        public void Create(LawyerViewModel db)
        {
            var entity = new Lawyer_Table();

            entity.LawyerName    = db.LawyerName;
            entity.LawyerPhone   = db.LawyerPhone;
            entity.LawyerAddress = db.LawyerAddress;
            entities.Lawyer_Table.Add(entity);
            entities.SaveChanges();

            db.LawyerID = entity.LawyerID;
        }
Esempio n. 3
0
        public void Update(LawyerViewModel db)
        {
            var entity = new Lawyer_Table();

            entity.LawyerID      = db.LawyerID;
            entity.LawyerName    = db.LawyerName;
            entity.LawyerPhone   = db.LawyerPhone;
            entity.LawyerAddress = db.LawyerAddress;



            entities.Lawyer_Table.Attach(entity);
            entities.Entry(entity).State = EntityState.Modified;
            entities.SaveChanges();
        }