private void LoadProducts() { using (TechContext context = new TechContext()) { var categories = context.Categories.ToList(); rptMenu.DataSource = categories; rptMenu.DataBind(); } }
public void LoadProducts(string categoryId) { int id = int.Parse(categoryId); using (TechContext context = new TechContext()) { var productList = context.Products.Where(p => p.CategoryID == id).ToList(); productslv.DataSource = productList; productslv.DataBind(); lvGridProduct.DataSource = productList; lvGridProduct.DataBind(); } }
//public override void VerifyRenderingInServerForm(Control control) //{ //} // Form hatası vermesin diye ekledik. private void LoadCategories() { using (TechContext context = new TechContext()) { var categoryList = context.Categories.ToList(); categorySelect.DataSource = categoryList; categorySelect.DataTextField = "CategoryName"; categorySelect.DataValueField = "CategoryID"; categorySelect.DataBind(); categorySelect.Items.Insert(0, "Select Category"); categorySelect.Items[0].Attributes["disabled"] = "disabled"; categorySelect.Items[0].Selected = true; } }
public ActionResult Register(Speaker speaker) { if (ModelState.IsValid) { using (TechContext db = new TechContext()) { db.Speaker.Add(speaker); db.SaveChanges(); ModelState.Clear(); speaker = null; ViewBag.Message = "Successfully Registration Done"; TempData["Success"] = "Success message text."; return RedirectToAction("Index", "Home"); } } else return View(speaker); //return RedirectToAction("Index", "Home"); }
public ActionResult Register(Speaker speaker) { if (ModelState.IsValid) { using (TechContext db = new TechContext()) { db.Speaker.Add(speaker); db.SaveChanges(); ModelState.Clear(); speaker = null; ViewBag.Message = "Successfully Registration Done"; TempData["Success"] = "Success message text."; return(RedirectToAction("Index", "Home")); } } else { return(View(speaker)); } //return RedirectToAction("Index", "Home"); }
public MainController(TechContext context, DapperContext dappercontext) { _context = context; _dappercontext = dappercontext; }
public ProductIncomsController(DapperContext dappercontext, TechContext context) { _dappercontext = dappercontext; _context = context; }
public UnitsController(TechContext context) { _context = context; }
public TechServicesController(TechContext context) { _context = context; }
public ProductTypesController(TechContext context) { _context = context; }
public UsersController(TechContext context) { _context = context; }
public UserProfileController(TechContext context) { _context = context; }
public CustomersController(TechContext context) { _context = context; }
public DropDownController(TechContext context, DapperContext dappercontext) { _context = context; _dappercontext = dappercontext; }
public RolesController(TechContext context) { _context = context; }
public SuppliersController(TechContext context) { _context = context; }
public ReturnsViewController(DapperContext dappercontext, TechContext context) { _dappercontext = dappercontext; _context = context; }
public GetTotalsController(TechContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public ProductsController(TechContext context, DapperContext dappercontext) { _context = context; _dappercontext = dappercontext; }
public HistorySaleController(TechContext context, DapperContext dappercontext) { _context = context; _dappercontext = dappercontext; }
public AuthService(IConfiguration configuration, TechContext context, IMapper mapper) { _configuration = configuration; _context = context; _mapper = mapper; }