예제 #1
0
        public SubjectMatter Create(string name, int museumId)
        {
            var subjectMatter = new SubjectMatter();

            subjectMatter.Name     = name;
            subjectMatter.MuseumId = museumId;

            return(subjectMatter);
        }
        public void Save(SubjectMatter model)
        {
            if (model.SubjectMatterId != 0)
            {
                _context.SubjectMatter.Update(model);
            }
            else
            {
                _context.Add(model);
            }

            _context.SaveChanges();
        }
예제 #3
0
        private void PopulateSubjectMatter()
        {
            SubjectMatter sm = new SubjectMatter();

            sm.CurrentUser = LoginName;
            DataSet ds;

            ds = sm.GetAllActiveRecords();
            if (ds.Tables[0].Rows.Count > 0)
            {
                dgSubjectMatter.DataSource = ds.Tables[0];
                dgSubjectMatter.DataBind();
            }
        }
예제 #4
0
        private void PopulateDropDowns()
        {
            DataTable tbl;

            try
            {
                //SBU sbu = new SBU();
                //tbl = sbu.GetAllActiveRecords().Tables[0];
                //tbl.Rows.InsertAt(tbl.NewRow(), 0);
                //dvSBU = tbl.DefaultView;

                BusinessUnit bu = new BusinessUnit();
                bu.CurrentUser = LoginName;
                tbl            = bu.GetAllRecords().Tables[0];
                dvBU           = tbl.DefaultView;

                Project prj = new Project();
                prj.CurrentUser = LoginName;
                tbl             = prj.GetAllActiveRecords().Tables[0];
                dvProject       = tbl.DefaultView;


                //Populate list box
                SubjectMatter sm = new SubjectMatter();
                sm.CurrentUser = LoginName;
                tbl            = sm.GetAllActiveRecords().Tables[0];
                dvProcess      = tbl.DefaultView;

                Discipline disc = new Discipline();
                disc.CurrentUser = LoginName;
                tbl          = disc.GetAllActiveRecords().Tables[0];
                dvDiscipline = tbl.DefaultView;

                Category cat = new Category();
                cat.CurrentUser = LoginName;
                tbl             = cat.GetAllActiveRecords().Tables[0];
                dvCategory      = tbl.DefaultView;

                Stages stage = new Stages();
                stage.CurrentUser = LoginName;
                tbl      = stage.GetAllActiveRecords().Tables[0];
                dvStages = tbl.DefaultView;
            }
            catch (System.Exception ex)
            {
                throw new Backend.LLException("Failed to load list boxes and drop down lists.", ex);
            }
        }
예제 #5
0
        private SubjectMatter GetSubjectMatter(CreatePieceModel model)
        {
            SubjectMatter subjectMatter = null;

            if (model.SubjectMatterId >= 0)
            {
                subjectMatter = repository.GetSubjectMatter(model.SubjectMatterId.Value);
            }
            else if (model.SubjectMatterId < 0 && !string.IsNullOrWhiteSpace(model.SubjectMatterName))
            {
                subjectMatter = repository.GetSubjectMatters().SingleOrDefault(g => g.Name == model.SubjectMatterName && g.MuseumId == model.MuseumId);
                if (subjectMatter == null)
                {
                    subjectMatter = subjectMatterFactory.Create(model.SubjectMatterName, model.MuseumId);

                    repository.AddSubjectMatter(subjectMatter);
                }
            }

            return(subjectMatter);
        }
예제 #6
0
        public void Save(SubjectMatter model)
        {
            var now = DateTime.Now;

            if (model.SubjectMatterId != 0)
            {
                model.UpgradeDate = now;

                if (model.TracingStudyPlanDevelopment.TeacherId == 0)
                {
                    model.TracingStudyPlanDevelopment.TeacherId = null;
                }

                _context.SubjectMatter.Update(model);
            }
            else
            {
                model.CreationDate = now;
                model.StatusId     = StatusValues.Activo;
                _context.Add(model);
            }

            _context.SaveChanges();
        }
예제 #7
0
        public bool CheckIfSubjectMatterCodeExits(SubjectMatter subjectMatter)
        {
            var checkIfItExits = GetAll.FirstOrDefault(x => x.SubjectMatterCode == subjectMatter.SubjectMatterCode &&
                                                       x.ScholarshipProgramUniversityId == subjectMatter.ScholarshipProgramUniversityId);


            bool result = false;;

            if (checkIfItExits != null)
            {
                if (checkIfItExits.SubjectMatterId != subjectMatter.SubjectMatterId)
                {
                    result = true;
                }
            }

            if (checkIfItExits != null)
            {
                _context.Entry(checkIfItExits).State = EntityState.Detached;
                _context.Entry(checkIfItExits.TracingStudyPlanDevelopment).State = EntityState.Detached;
            }

            return(result);
        }
예제 #8
0
        public Piece Create(
            int recordNumber,
            string title,
            string accessionNumber,
            int?creationDay,
            int?creationMonth,
            int?creationYear,
            Country countryOfOrigin,
            string stateOfOrigin,
            string cityOfOrigin,
            double?height,
            double?width,
            double?depth,
            UnitOfMeasure unitOfMeasure,
            decimal?estimatedValue,
            string subject,
            int?copyrightYear,
            string copyrightOwner,
            string insurancePolicyNumber,
            DateTime?insuranceExpirationDate,
            decimal?insuanceAmount,
            string insuranceCarrier,
            bool isFramed,
            bool isArchived,
            Artist artist,
            Medium medium,
            Genre genre,
            Subgenre subgenre,
            SubjectMatter subjectMatter,
            Acquisition acquisition,
            Location currentLocation,
            Location permanentLocation,
            Collection collection,
            string lastModifiedByUserId,
            DateTime lastModified,
            int museumId)
        {
            var piece = new Piece();

            piece.RecordNumber            = recordNumber;
            piece.Title                   = title;
            piece.AccessionNumber         = accessionNumber;
            piece.CreationDay             = creationDay;
            piece.CreationMonth           = creationMonth;
            piece.CreationYear            = creationYear;
            piece.CountryOfOrigin         = countryOfOrigin;
            piece.StateOfOrigin           = stateOfOrigin;
            piece.CityOfOrigin            = cityOfOrigin;
            piece.Height                  = height;
            piece.Width                   = width;
            piece.Depth                   = depth;
            piece.UnitOfMeasure           = unitOfMeasure;
            piece.EstimatedValue          = estimatedValue;
            piece.Subject                 = subject;
            piece.CopyrightYear           = copyrightYear;
            piece.CopyrightOwner          = copyrightOwner;
            piece.InsurancePolicyNumber   = insurancePolicyNumber;
            piece.InsuranceExpirationDate = insuranceExpirationDate;
            piece.InsuranceAmount         = insuanceAmount;
            piece.InsuranceCarrier        = insuranceCarrier;
            piece.IsFramed                = isFramed;
            piece.IsArchived              = isArchived;
            piece.Artist                  = artist;
            piece.Medium                  = medium;
            piece.Genre                   = genre;
            piece.Subgenre                = subgenre;
            piece.SubjectMatter           = subjectMatter;
            piece.Acquisition             = acquisition;
            piece.CurrentLocation         = currentLocation;
            piece.PermanentLocation       = permanentLocation;
            piece.Collection              = collection;
            piece.ApplicationUserId       = lastModifiedByUserId;
            piece.LastModified            = lastModified;
            piece.MuseumId                = museumId;

            return(piece);
        }
예제 #9
0
        public bool CheckIfSubjectMatterCodeExits(SubjectMatter data)
        {
            var check = _subjectMatter.CheckIfSubjectMatterCodeExits(data);

            return(check);
        }
예제 #10
0
 public void AddSubjectMatter(SubjectMatter subjectMatter)
 {
     subjectMatterRepository.Add(subjectMatter);
 }