Beispiel #1
0
        public string[] LoadTypesToCombobox()
        {
            using (var context = new CCContext())
            {
                var      types     = context.Types.GroupBy(t => t.TypeId);
                string[] typeArray = new string[types.Count()];
                int      i         = 0;

                foreach (var groupItem in types)
                {
                    foreach (var type in groupItem)
                    {
                        typeArray[i] = type.Name;
                        i++;
                    }
                }
                return(typeArray);
            }
        }
Beispiel #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            plateId  = Intent.GetIntExtra("plateId", -1);
            imageUri = Uri.Parse(Intent.GetStringExtra("imageUri"));

            SetContentView(Resource.Layout.activity_count);

            //toolbarViewGroup = (ViewGroup)FindViewById(Resource.Id.toolbar);
            countView = (CountView)FindViewById(Resource.Id.countView);

            ccContext = AppAndroid.CCContext;
            countView.SetContext(ccContext);

            //toolbar = new Toolbar(this.BaseContext, ccContext, toolbarViewGroup);

            //toolbar.SetupCountToolbar();
        }
Beispiel #3
0
 public void createType(string name, int minAtk, int maxAtk, int minDef, int maxDef, int minCost, int maxCost)
 {
     using (var context = new CCContext())
     {
         var type = new Type()
         {
             Name        = name,
             Min_Attack  = minAtk,
             Max_Attack  = maxAtk,
             Min_Defence = minDef,
             Max_Defence = maxDef,
             Min_Cost    = minCost,
             Max_Cost    = maxCost,
         };
         context.Types.Add(type);
         context.SaveChanges();
         Console.WriteLine("Added type to database");
     }
 }
Beispiel #4
0
        public void createNewCard(string name, int atk, int def, int cost, string imgsource, string SelectedType)
        {
            using (var context = new CCContext())
            {
                var type = context.Types.First(t => t.Name == SelectedType);

                var cards = new Card
                {
                    Name    = Name,
                    Attack  = Attack,
                    Defence = Defence,
                    Cost    = Cost,
                    TypeId  = type.TypeId,
                    Image   = ImageSource
                };
                context.Cards.Add(cards);
                context.SaveChanges();
                Console.WriteLine("Added to database");
            }
        }
Beispiel #5
0
        public static void Initialize(Context context)
        {
            if (AppAndroid.context != null)
            {
                return;
            }

            AppAndroid.context = context;
            int zoomWidth    = PixelsFromDP(128);
            int zoomOffset   = -PixelsFromDP(100);
            int selectRadius = PixelsFromDP(30);
            int tagSize      = PixelsFromDP(4);


            //			string dbPath = System.IO.Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "database.db");


            string dbPath = System.IO.Path.Combine(context.GetExternalFilesDir(null).AbsolutePath, "database.db");

            ccContext = new CCContext(zoomWidth, zoomOffset, selectRadius, tagSize, dbPath);
        }
Beispiel #6
0
 public StoreBl(CCContext ccContext)
 {
     _storeDataAccess = new StoreDataAccess(ccContext);
 }
 public StatisticsController(CCContext ccContext)
 {
     _ccContext = ccContext;
 }
Beispiel #8
0
 public UserBl(CCContext context)
 {
     _userDal = new UserDataAccess(context);
 }
Beispiel #9
0
 public UsersController(CCContext context)
 {
     _context = context;
 }
 public AdminController(IOptions <AppSettings> settings, CCContext ccContext)
 {
     _settings        = settings.Value.AdminCredentials;
     _adminDataAccess = new AdminDataAccess(ccContext);
     _userDataAccess  = new UserDataAccess(ccContext);
 }
 public CatalogController(CCContext ccContext)
 {
     _productBl = new ProductBl(ccContext);
     _storeBl   = new StoreBl(ccContext);
 }
Beispiel #12
0
 public CommentBl(CCContext context)
 {
     _productDal = new ProductDataAccess(context);
     _userDal    = new UserDataAccess(context);
 }
Beispiel #13
0
 public ReviewsController(CCContext context)
 {
     _context = context;
 }
Beispiel #14
0
 public void SetContext(CCContext ccContext)
 {
     this.ccContext          = ccContext;
     ccContext.RequestRender = OnReqestRender;
     renderer.SetCCContext(ccContext);
 }
Beispiel #15
0
 public UserDataAccess(CCContext context)
 {
     _ccContext = context;
 }
Beispiel #16
0
 public CommentController(CCContext context)
 {
     _commentBl = new CommentBl(context);
 }
Beispiel #17
0
 public LikeController(CCContext context)
 {
     _likeBl = new LikeBl(context);
 }
Beispiel #18
0
 public HomeController(CCContext context)
 {
     _context = context;
 }
 public AdminDataAccess(CCContext ccContext)
 {
     _ccContext = ccContext;
 }
Beispiel #20
0
 public UserController(CCContext context)
 {
     _userBl = new UserBl(context);
 }
Beispiel #21
0
 public StoreController(CCContext ccContext)
 {
     _storeBl = new StoreBl(ccContext);
 }
Beispiel #22
0
 public ProductDataAccess(CCContext ccContext)
 {
     _ccContext = ccContext;
 }
 public AboutController(CCContext ccContext, [FromServices] ISecretSettings secrets)
 {
     _storeBl = new StoreBl(ccContext);
     _secrets = secrets;
 }
Beispiel #24
0
 public ProductBl(CCContext ccContext)
 {
     _productDataAccess = new ProductDataAccess(ccContext);
 }
Beispiel #25
0
 public void SetCCContext(CCContext ccContext)
 {
     this.ccContext = ccContext;
     ccContext.SetupImageTexture = HandleSetupImageTexture;
     ccContext.ProjectionMatrix  = Matrix4.CreateOrthographicOffCenter(0, viewSize.Width, viewSize.Height, 0, -1, 1);
 }
Beispiel #26
0
 public HomeController(CCContext ccContext)
 {
     _productBl = new ProductBl(ccContext);
 }
Beispiel #27
0
 public StrainInfoController(CCContext context)
 {
     _context = context;
 }
 public StoreDataAccess(CCContext ccContext)
 {
     _ccContext = ccContext;
 }
 public ComPersonaController(CCContext context)
 {
     _context = context;
 }