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); } }
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(); }
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"); } }
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"); } }
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); }
public StoreBl(CCContext ccContext) { _storeDataAccess = new StoreDataAccess(ccContext); }
public StatisticsController(CCContext ccContext) { _ccContext = ccContext; }
public UserBl(CCContext context) { _userDal = new UserDataAccess(context); }
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); }
public CommentBl(CCContext context) { _productDal = new ProductDataAccess(context); _userDal = new UserDataAccess(context); }
public ReviewsController(CCContext context) { _context = context; }
public void SetContext(CCContext ccContext) { this.ccContext = ccContext; ccContext.RequestRender = OnReqestRender; renderer.SetCCContext(ccContext); }
public UserDataAccess(CCContext context) { _ccContext = context; }
public CommentController(CCContext context) { _commentBl = new CommentBl(context); }
public LikeController(CCContext context) { _likeBl = new LikeBl(context); }
public HomeController(CCContext context) { _context = context; }
public AdminDataAccess(CCContext ccContext) { _ccContext = ccContext; }
public UserController(CCContext context) { _userBl = new UserBl(context); }
public StoreController(CCContext ccContext) { _storeBl = new StoreBl(ccContext); }
public ProductDataAccess(CCContext ccContext) { _ccContext = ccContext; }
public AboutController(CCContext ccContext, [FromServices] ISecretSettings secrets) { _storeBl = new StoreBl(ccContext); _secrets = secrets; }
public ProductBl(CCContext ccContext) { _productDataAccess = new ProductDataAccess(ccContext); }
public void SetCCContext(CCContext ccContext) { this.ccContext = ccContext; ccContext.SetupImageTexture = HandleSetupImageTexture; ccContext.ProjectionMatrix = Matrix4.CreateOrthographicOffCenter(0, viewSize.Width, viewSize.Height, 0, -1, 1); }
public HomeController(CCContext ccContext) { _productBl = new ProductBl(ccContext); }
public StrainInfoController(CCContext context) { _context = context; }
public StoreDataAccess(CCContext ccContext) { _ccContext = ccContext; }
public ComPersonaController(CCContext context) { _context = context; }