Esempio n. 1
0
        public ActionResult InventoryDelete(InventoryModel inventoryModel)
        {
            var requestResult = inventoryLogic.Delete(inventoryModel);

            InvertoryViewModel = new InvertoryViewModel();
            InvertoryViewModel.ProductModel = new ProductModel()
            {
                EndUserMessage = requestResult.EndUserMessage,
                Status         = requestResult.Status
            };
            return(RedirectToAction("InvertoriesList"));
        }
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee      e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));

        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
        {
            InventoryLogic          il = new InventoryLogic();
            BusinessLogic.Inventory e1 = il.SelectByID(Convert.ToInt32(e.CommandArgument));
            if (e1 != null)
            {
                il.Delete(e1.InventoryID);
                Response.Redirect("InventoryList.aspx");
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }
    }
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        EmployeeLogic el = new EmployeeLogic();
        Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"]));
        if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE"))
        {
            InventoryLogic il = new InventoryLogic();
            BusinessLogic.Inventory e1 = il.SelectByID(Convert.ToInt32(e.CommandArgument));
            if (e1 != null)
            {

                il.Delete(e1.InventoryID);
                Response.Redirect("InventoryList.aspx");
            }
        }
        else
        {
            Response.Redirect("Access.aspx");
        }

    }