Exemplo n.º 1
0
        public static int GetTypeId(string typeName)
        {
            ProductTypeDao productTypeDao = new ProductTypeDao();
            int            typeId         = productTypeDao.GetTypeId(typeName);

            if (typeId > 0)
            {
                return(typeId);
            }
            ProductTypeInfo productTypeInfo = new ProductTypeInfo();

            productTypeInfo.TypeName = typeName;
            return((int)productTypeDao.Add(productTypeInfo, null));
        }
Exemplo n.º 2
0
        public static int GetTypeId(string typeName)
        {
            ProductTypeDao productTypeDao = new ProductTypeDao();
            int            typeId         = productTypeDao.GetTypeId(typeName);
            int            result;

            if (typeId > 0)
            {
                result = typeId;
            }
            else
            {
                result = productTypeDao.AddProductType(new ProductTypeInfo
                {
                    TypeName = typeName
                });
            }
            return(result);
        }