// GET: AdminProduct
        public ActionResult Product()
        {
            if (Session["Login"] != null && Session["Company"] != null)
            {
                gelen        = (AppUsers)Session["Login"];
                companybilgi = (Company)Session["Company"];

                if (gelen.Status.Value == 2)
                {
                    if (storageManagement.getAllCompanyStorage(companybilgi.CompanyID) == null)
                    {
                        return(RedirectToAction("NoStorage", "AdminProduct"));
                    }
                    ViewBag.categori = categoryManagement.GetAllCategory();
                    new SelectList(categoryManagement.GetAllCategory(), "CategoryID", "CategoryName", 1);
                    ViewBag.storage = storageManagement.getAllCompanyStorage(companybilgi.CompanyID);
                    new SelectList(storageManagement.getAllCompanyStorage(companybilgi.CompanyID), "StorageID", "StorageName", 0);
                    ViewBag.cargo = cargoManagement.getAllCargo();

                    return(View());
                }
                else
                {
                    return(RedirectToAction("Index", "Admin"));
                }
            }
            else
            {
                return(RedirectToAction("Storage", "AdminStorage"));
            }
        }
示例#2
0
        public ActionResult ProductModification(int id)
        {
            if (Session["Login"] != null && Session["Company"] != null)
            {
                gelen        = (AppUsers)Session["Login"];
                companybilgi = (Company)Session["Company"];
            }
            else
            {
                return(RedirectToAction("Index", "Home", new { area = "" }));
            }

            if (productManagement.GetProductById(id) != null && companybilgi.Products.Where(s => s.ProductID == id).Count() > 0)
            {
                if (gelen.Status.Value == 2)
                {
                    StockManagement.Areas.Admin.Models.ProductModel productModel = new Models.ProductModel();
                    productModel.cargo      = cargoManagement.getAllCargo();
                    productModel.categories = categoryManagement.GetAllCategory();
                    productModel.storage    = storageManagement.getAllCompanyStorage(companybilgi.CompanyID);
                    productModel.product    = productManagement.GetProductById(id);
                    Session["hata"]         = productModel.product.ProductID;
                    return(View(productModel));
                }
                else
                {
                    return(RedirectToAction("Index", "Admin"));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Admin"));
            }
        }
示例#3
0
 public ActionResult Cargo()
 {
     if (Session["Login"] != null)
     {
         gelen = (AppUsers)Session["Login"];
     }
     else
     {
         return(RedirectToAction("Index", "Home", new { area = "" }));
     }
     if (gelen.Status.Value == 3)
     {
         var allCargo = cargoManagement.getAllCargo();
         return(View(allCargo));
     }
     else
     {
         return(RedirectToAction("Index", "Admin"));
     }
 }