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;
            }
        }
コード例 #4
0
 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");
 }
コード例 #5
0
 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");
 }
コード例 #6
0
 public MainController(TechContext context, DapperContext dappercontext)
 {
     _context       = context;
     _dappercontext = dappercontext;
 }
コード例 #7
0
 public ProductIncomsController(DapperContext dappercontext, TechContext context)
 {
     _dappercontext = dappercontext;
     _context       = context;
 }
コード例 #8
0
 public UnitsController(TechContext context)
 {
     _context = context;
 }
コード例 #9
0
 public TechServicesController(TechContext context)
 {
     _context = context;
 }
コード例 #10
0
 public ProductTypesController(TechContext context)
 {
     _context = context;
 }
コード例 #11
0
 public UsersController(TechContext context)
 {
     _context = context;
 }
コード例 #12
0
 public UserProfileController(TechContext context)
 {
     _context = context;
 }
コード例 #13
0
 public CustomersController(TechContext context)
 {
     _context = context;
 }
コード例 #14
0
 public DropDownController(TechContext context, DapperContext dappercontext)
 {
     _context       = context;
     _dappercontext = dappercontext;
 }
コード例 #15
0
 public RolesController(TechContext context)
 {
     _context = context;
 }
コード例 #16
0
 public SuppliersController(TechContext context)
 {
     _context = context;
 }
コード例 #17
0
 public ReturnsViewController(DapperContext dappercontext, TechContext context)
 {
     _dappercontext = dappercontext;
     _context       = context;
 }
コード例 #18
0
 public GetTotalsController(TechContext context, IMapper mapper)
 {
     _context = context;
     _mapper  = mapper;
 }
コード例 #19
0
 public ProductsController(TechContext context, DapperContext dappercontext)
 {
     _context       = context;
     _dappercontext = dappercontext;
 }
コード例 #20
0
 public HistorySaleController(TechContext context, DapperContext dappercontext)
 {
     _context       = context;
     _dappercontext = dappercontext;
 }
コード例 #21
0
 public AuthService(IConfiguration configuration, TechContext context, IMapper mapper)
 {
     _configuration = configuration;
     _context       = context;
     _mapper        = mapper;
 }