Beispiel #1
0
        public void Update(business2field business2field)
        {
            var oldbusiness2field = _business2fields.Where(b => b.BusinessFieldID == business2field.BusinessFieldID).FirstOrDefault();

            if (oldbusiness2field != null)
            {
                _business2fields.Remove(oldbusiness2field);
                _business2fields.Add(business2field);
                _ds.Update(business2field);
            }
        }
Beispiel #2
0
        private void Update(List <string> fields, int businessID)
        {
            using (TechCareerFair.DAL.Business2FieldDAL.Business2FieldDatabaseDataService ds = new Business2FieldDAL.Business2FieldDatabaseDataService())
            {
                List <business2field> b2fs = ds.Read();

                foreach (string name in fields)
                {
                    business2field b2f        = new business2field();
                    int            fieldIndex = DatabaseHelper.GetFieldIndex(name);

                    b2f.Business = businessID;
                    b2f.Field    = fieldIndex;

                    ds.Update(b2f);
                }
            }
        }