public void Create(SystemicIssuesViewModel db)
        {
            var entity = new SystemicIssues_Table();

            entity.CenterNumber      = db.CenterNumber;
            entity.CourtsNumber      = db.CourtsNumber;
            entity.DateOfCase        = (DateTime)db.DateOfCase.Date;
            entity.DepositDate       = (DateTime)db.DepositDate.Date;
            entity.ClientName        = db.ClientName;
            entity.ClientIDNumber    = db.ClientIDNumber;
            entity.ClientPhone       = db.ClientPhone;
            entity.ClientAddress     = db.ClientAddress;
            entity.AdversaryName     = db.AdversaryName;
            entity.AdversaryIDNumber = db.AdversaryIDNumber;
            entity.AdversaryPhone    = db.AdversaryPhone;
            entity.AdversaryAddress  = db.AdversaryAddress;
            entity.TypeOfCaseID      = db.TypeOfCaseID;
            entity.CourtsID          = db.CourtsID;
            entity.LawyerID          = db.LawyerID;
            entity.DateOfClosure     = (DateTime)db.DateOfClosure.Date;
            entity.UserID            = db.UserID;
            entities.SystemicIssues_Table.Add(entity);
            entities.SaveChanges();

            db.SystemicIssuesID = entity.SystemicIssuesID;
        }
        public void Update(SystemicIssuesViewModel db)
        {
            var entity = new SystemicIssues_Table();

            entity.SystemicIssuesID  = db.SystemicIssuesID;
            entity.CourtsNumber      = db.CourtsNumber;
            entity.DateOfCase        = (DateTime)db.DateOfCase.Date;
            entity.DepositDate       = (DateTime)db.DepositDate.Date;
            entity.ClientName        = db.ClientName;
            entity.ClientGendr       = db.ClientGendr;
            entity.ClientIDNumber    = db.ClientIDNumber;
            entity.ClientPhone       = db.ClientPhone;
            entity.ClientAddress     = db.ClientAddress;
            entity.AdversaryName     = db.AdversaryName;
            entity.AdversaryIDNumber = db.AdversaryIDNumber;
            entity.AdversaryPhone    = db.AdversaryPhone;
            entity.AdversaryAddress  = db.AdversaryAddress;
            entity.TypeOfCase_ID     = db.TypeOfCaseID;
            entity.CourtsID          = db.CourtsID;
            entity.LawyerID          = db.LawyerID;
            entity.DateOfClosure     = (DateTime)db.DateOfClosure.Date;
            entity.UserID            = db.UserID;
            entity.ProjectID         = db.ProjectID;


            entities.SystemicIssues_Table.Attach(entity);
            entities.Entry(entity).State = EntityState.Modified;
            entities.SaveChanges();
        }
        public void Destroy(SystemicIssuesViewModel db)
        {
            var entity = new SystemicIssues_Table();

            entity.SystemicIssuesID = db.SystemicIssuesID;

            entities.SystemicIssues_Table.Attach(entity);

            entities.SystemicIssues_Table.Remove(entity);

            entities.SaveChanges();
        }