Ejemplo n.º 1
0
        public void EditLicense(LicenseViewModel model)
        {
            var data = (from license in ContextPerRequest.CurrentData.LicenseSchedules
                        where license.LicenseID == model.LicenseID
                        select license).FirstOrDefault();

            data.License        = model.License;
            data.LicenseType    = model.LicenseType;
            data.ExpirationDate = model.ExpirationDate;
            data.StateAgency    = model.StateAgency;
            //data.IsActive = model.IsActive;
            ContextPerRequest.CurrentData.SaveChanges();
        }
Ejemplo n.º 2
0
        public void AddLicense(LicenseViewModel model)
        {
            LicenseSchedule license = new LicenseSchedule
            {
                DateAdded      = DateTime.Now,
                ExpirationDate = model.ExpirationDate,
                IsActive       = true,
                License        = model.License,
                LicenseType    = model.LicenseType,
                MemberID       = model.MemberID,
                StateAgency    = model.StateAgency
            };

            ContextPerRequest.CurrentData.LicenseSchedules.Add(license);
            ContextPerRequest.CurrentData.SaveChanges();
        }