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 JsonResult UploadExcel(ProductOpening ObjOpening)
        {
            ViewBag.msg = "";
            try
            {

                if (SaveExcelFile(ObjOpening.ExcelFile))
                {
                    LP_Inventory objINV = new LP_Inventory();
                    DataTable dt =Helper.ToDataTable(ReadExcelFile(ObjOpening.ExcelFile.FileName));
                    LP_Inventory_BLL objINVBLL = new LP_Inventory_BLL();
                    objINVBLL.UploadExcel(dt, dt);
                    // objattendancebll = new Attendance_BLL();
                    var flag = true;// objattendancebll.Insert(objattendanceproperty.tbl_Attendance);
                    if (flag)
                    {
                        ViewBag.msg = "Success";
                    }
                    else
                    {
                        ViewBag.msg = "Contact Administrator";
                    }

                }

                return Json(new { success = true, msg = ViewBag.msg }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                return Json(new { success = false, msg = "Contact Administrator" }, 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 DataTable GetInvoceData(int id, string table)

        {
            try
            {
                LP_Inventory_BLL objLP_Inventory_BLL = new LP_Inventory_BLL();
                return(objLP_Inventory_BLL.GetInventoryReport().Tables[0]);
            }
            catch (Exception ex)
            {
                return(new DataTable());
            }
        }
        public JsonResult TransferInventory(LP_Inventory_Movement objINV)

        {
            try
            {
                objINV.TransactionType = 12;
                objINV.Useridx         = Convert.ToInt32(Session["UID"].ToString());
                objINV.DateCreated     = DateTime.Now;
                objINV.DetailData      = Helper.ToDataTable <LP_InventoryLogs_Property>(objINV.InventoryLogs);
                objLP_Inventory_BLL    = new LP_Inventory_BLL();
                bool flag = objLP_Inventory_BLL.TransferInventory(objINV);
                return(Json(new { data = "/Reports/InventoryReport.Pdf", success = flag, 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 JsonResult SelectAllInventory()

        {
            if (Session["LOGGEDIN"] != null)
            {
                try
                {
                    objLP_Inventory_BLL = new LP_Inventory_BLL();
                    var Data = JsonConvert.SerializeObject(objLP_Inventory_BLL.SelectAll());
                    return(Json(new { data = Data, success = true, statuscode = 200, count = Data.Length }, 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));
            }
        }