Example #1
0
        public void InsertList(List <tb_m_component> _lists)
        {
            foreach (tb_m_component tmp in _lists)
            {
                switch (tmp.RowState)
                {
                case CommandNameEnum.Add:
                    _repository.Add(tmp);
                    break;

                case CommandNameEnum.Edit:
                    tb_m_component existing = _repository.Find(x => x.ID == tmp.ID).FirstOrDefault();
                    _repository.Edit(existing, tmp);
                    break;
                }
            }
        }
Example #2
0
        public void Update()
        {
            tb_m_component existing = _repository.Find(x => x.ID == this.ID).FirstOrDefault();

            _repository.Edit(existing, this);
        }