Пример #1
0
        public bool CardboardProfileExists(string name)
        {
            PLMPackEntities db   = new PLMPackEntities();
            AspNetUser      user = AspNetUser.GetByUserName(db, UserName);

            return(CardboardProfile.Exists(db, user.CurrentGroup(db), name));
        }
Пример #2
0
        static void Main(string[] args)
        {
            XmlConfigurator.Configure();

            try
            {
                PLMPackLibDb db = new PLMPackLibDb();
                #region Cardboad formats
                // create formats
                CardboardFormat cbf = null;
                if (!CardboardFormat.Exists(db, "F1"))
                {
                    cbf = CardboardFormat.CreateNew(db, "F1", "Form1", 1000.0f, 1000.0f);
                }
                if (!CardboardFormat.Exists(db, "F2"))
                {
                    cbf = CardboardFormat.CreateNew(db, "F2", "Form2", 2000.0f, 2000.0f);
                }
                if (!CardboardFormat.Exists(db, "F3"))
                {
                    cbf = CardboardFormat.CreateNew(db, "F3", "Form3", 3000.0f, 3000.0f);
                }
                // get list of formats
                foreach (CardboardFormat f in CardboardFormat.GetAll(db))
                {
                    _log.Info(f.ToString());
                }
                #endregion

                #region Cardboard profile
                CardboardProfile cbp = null;
                if (!CardboardProfile.Exists(db, "P1"))
                {
                    cbp = CardboardProfile.CreateNew(db, "P1", "Profile 1", 1.0f);
                }
                #endregion
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
            }
        }