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");
 }
Ejemplo n.º 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");
 }
Ejemplo n.º 6
0
 public MainController(TechContext context, DapperContext dappercontext)
 {
     _context       = context;
     _dappercontext = dappercontext;
 }
Ejemplo n.º 7
0
 public ProductIncomsController(DapperContext dappercontext, TechContext context)
 {
     _dappercontext = dappercontext;
     _context       = context;
 }
Ejemplo n.º 8
0
 public UnitsController(TechContext context)
 {
     _context = context;
 }
Ejemplo n.º 9
0
 public TechServicesController(TechContext context)
 {
     _context = context;
 }
 public ProductTypesController(TechContext context)
 {
     _context = context;
 }
Ejemplo n.º 11
0
 public UsersController(TechContext context)
 {
     _context = context;
 }
Ejemplo n.º 12
0
 public UserProfileController(TechContext context)
 {
     _context = context;
 }
Ejemplo n.º 13
0
 public CustomersController(TechContext context)
 {
     _context = context;
 }
Ejemplo n.º 14
0
 public DropDownController(TechContext context, DapperContext dappercontext)
 {
     _context       = context;
     _dappercontext = dappercontext;
 }
Ejemplo n.º 15
0
 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;
 }
Ejemplo n.º 21
0
 public AuthService(IConfiguration configuration, TechContext context, IMapper mapper)
 {
     _configuration = configuration;
     _context       = context;
     _mapper        = mapper;
 }