public ActionResult ViewInventory()
        {
            string actionName     = this.ControllerContext.RouteData.Values["action"].ToString();
            string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
            string pagename       = @"/" + controllerName + @"/" + actionName;
            var    page           = (List <LP_Pages_Property>)Session["PageList"];

            if (Session["LoggedIn"] != null && Helper.CheckPageAccess(pagename, page))
            {
                LP_Inv_Report objinvrprt = new LP_Inv_Report();
                objinvrprt.BranchList  = Helper.ConvertDataTable <Branch_Property>(ViewAllBranches());
                objinvrprt.ProductList = Helper.ConvertDataTable <Product_Property>(ViewAllProduct());
                return(View(objinvrprt));
            }
            else
            {
                if (Session["LoggedIn"] == null)
                {
                    return(RedirectToAction("Login", "Account"));
                }
                else
                {
                    return(RedirectToAction("NotAuthorized", "Account"));
                }
            }
        }
        public JsonResult GenerateDetailReport(LP_Inv_Report objrprtparam)

        {
            try
            {
                objLP_Inventory_BLL = new LP_Inventory_BLL(objrprtparam);
                DataTable dt = objLP_Inventory_BLL.GetInventoryReport().Tables[0];

                //List<Customer> allCustomer = new List<Customer>();
                //allCustomer = context.Customers.ToList();


                ReportDocument rd = new ReportDocument();
                rd.Load(Path.Combine(Server.MapPath("~/Reports"), "InventoryReport.rpt"));

                rd.SetDataSource(dt);

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();


                rd.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Path.Combine(Server.MapPath("~/Reports"), "InventoryReport.Pdf"));
                //stream.Seek(0, SeekOrigin.Begin);
                //return File(stream, "application/pdf", "CustomerList.pdf");
                return(Json(new { data = "/Reports/InventoryReport.Pdf", success = true, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { data = "/Reports/InventoryReport.Pdf", success = true, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
            }
        }
        public DataTable GetInventoryInfo(LP_Inv_Report objrprtparam)

        {
            try
            {
                LP_Inventory_BLL objLP_Inventory_BLL = new LP_Inventory_BLL(objrprtparam);
                return(objLP_Inventory_BLL.GetInventoryReport().Tables[0]);
            }
            catch (Exception ex)
            {
                return(new DataTable());
            }
        }
        public ActionResult ViewInventory()
        {
            LP_Inv_Report objinvrprt = new LP_Inv_Report();

            if (Session["LOGGEDIN"] != null)
            {
                objinvrprt.BranchList  = Helper.ConvertDataTable <Branch_Property>(ViewAllBranches());
                objinvrprt.ProductList = Helper.ConvertDataTable <Product_Property>(ViewAllProduct());
                return(View(objinvrprt));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
            }
        }
        public new JsonResult GetInventoryInfo(LP_Inv_Report objrprtparam)
        {
            if (Session["LOGGEDIN"] != null)
            {
                try
                {
                    string stock = base.GetInventoryInfo(objrprtparam).Compute("SUM(stock)", string.Empty).ToString();


                    return(Json(new { data = stock, success = true, statuscode = 200, count = stock }, JsonRequestBehavior.AllowGet));
                }
                catch (Exception ex)
                {
                    return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
                }
            }
            else
            {
                return(Json(new { data = "Session Expired", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 6
0
 public Inventory_DAL(LP_Inv_Report _objLP_Inv_ReportProperty)
 {
     objLP_Inv_ReportProperty = _objLP_Inv_ReportProperty;
 }
Exemplo n.º 7
0
 public LP_Inventory_BLL(LP_Inv_Report _objLP_Inv_ReportProperty)
 {
     objLP_Inv_ReportProperty = _objLP_Inv_ReportProperty;
 }