Beispiel #1
0
        public void Update(MediationViewModel db)
        {
            var entity = new Mediation_Table();

            entity.MediationID        = db.MediationID;
            entity.MediationNumber    = db.MediationNumber;
            entity.MediationDate      = (DateTime)db.MediationDate.Date;
            entity.FirstSideName      = db.FirstSideName;
            entity.FirstSideIDNumber  = db.FirstSideIDNumber;
            entity.FirstSidePhone     = db.FirstSidePhone;
            entity.FirstSocialstatus  = db.FirstSocialstatus;
            entity.FirstSideAddress   = db.FirstSideAddress;
            entity.SecondSideName     = db.SecondSideName;
            entity.SecondSideIDNumber = db.SecondSideIDNumber;
            entity.SecondSidePhone    = db.SecondSidePhone;
            entity.SecondSocialstatus = db.SecondSocialstatus;
            entity.SecondSideAddress  = db.SecondSideAddress;
            entity.MediatorName       = db.MediatorName;
            entity.MediatorPhone      = db.MediatorPhone;
            entity.Agreement          = HttpUtility.HtmlDecode(db.Agreement);
            entity.UserID             = db.UserID;


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

            entity.MediationDate      = (DateTime)db.MediationDate.Date;
            entity.FirstSideName      = db.FirstSideName;
            entity.FirstSideGender    = db.FirstSideGender;
            entity.FirstSideAge       = db.FirstSideAge;
            entity.FirstSideIDNumber  = db.FirstSideIDNumber;
            entity.FirstSidePhone     = db.FirstSidePhone;
            entity.FirstSocialstatus  = db.FirstSocialstatus;
            entity.FirstSideAddress   = db.FirstSideAddress;
            entity.SecondSideName     = db.SecondSideName;
            entity.SecondSideIDNumber = db.SecondSideIDNumber;
            entity.SecondSidePhone    = db.SecondSidePhone;
            entity.SecondSocialstatus = db.SecondSocialstatus;
            entity.SecondSideAddress  = db.SecondSideAddress;
            entity.MediatorName       = db.MediatorName;
            entity.MediatorPhone      = db.MediatorPhone;
            entity.Agreement          = HttpUtility.HtmlDecode(db.Agreement);
            entity.UserID             = db.UserID;
            entity.IssuesTypeID       = db.IssuesTypeID;
            entity.DiligenceTypeID    = db.DiligenceTypeID;
            entity.ProjectID          = db.ProjectID;
            entities.Mediation_Table.Add(entity);
            entities.SaveChanges();

            db.MediationID = entity.MediationID;
        }
Beispiel #3
0
        public void Destroy(MediationViewModel db)
        {
            var entity = new Mediation_Table();

            entity.MediationID = db.MediationID;

            entities.Mediation_Table.Attach(entity);

            entities.Mediation_Table.Remove(entity);

            entities.SaveChanges();
        }