Exemple #1
0
        public void Insert(business2field business2field)
        {
            //business2field.BusinessFieldID = NextIdValue();
            //_business2fields.Add(business2field);

            _ds.Insert(business2field);
        }
Exemple #2
0
        private void Insert(List <string> fields, int businessID)
        {
            //insert field ID and business ID into new record of mapping table business2field
            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;
                    if (b2fs.Where(b => b.Field == fieldIndex).Where(b => b.Business == businessID).Count() == 0)
                    {
                        ds.Insert(b2f);
                    }
                }
            }
        }