public void GetInternalInvoiceReport(int internal_requisition_master_id, int user_id)
        {
            try
            {
                WebClient wbClient       = new WebClient();
                string    downloadString = CoreRules.httpRequest() + "InternalRequisition/InternalInvoiceReport?internal_requisition_master_id=" + internal_requisition_master_id + "&user_id=" + user_id;
                string    apidata        = wbClient.DownloadString(downloadString);
                var       oDeliAndDis    = JsonConvert.DeserializeObject <List <InternalInvoiceReportModel> >(apidata);
                DataTable dt             = ToDataTable(oDeliAndDis);

                using (var reportDocument = new ReportDocument())
                {
                    reportDocument.Load(Server.MapPath("~/Reports/crystal_view/InternalInvoiceReportData.rpt"));
                    reportDocument.SetDataSource(dt);
                    reportDocument.SummaryInfo.ReportTitle   = "Internal Invoice";
                    reportDocument.SummaryInfo.ReportSubject = "Internal Invoice";
                    reportDocument.SummaryInfo.ReportAuthor  = "WE SCM System";
                    reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "Lot No Print Report" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void GetRequisitionReport(int requisition_master_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Requisition/GetRequisitionReportById?requisition_master_id=" + requisition_master_id;
            string    apidata        = wbClient.DownloadString(downloadString);

            RequisitionCombinedModel oDeliAndDis = JsonConvert.DeserializeObject <RequisitionCombinedModel>(apidata);
            //convert list to datatable
            DataTable dtMain = ToDataTable(oDeliAndDis.RequisitionReportModels);

            //DataTable dtSub = ToDataTable(oDeliAndDis.RebateReportModels);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/RequisitionReport.rpt"));
                reportDocument.SetDataSource(dtMain);

                //rebate subreport
                //if (oDeliAndDis.RebateReportModels.Count > 0)
                //{
                //    reportDocument.OpenSubreport("rebate").SetDataSource(dtSub);
                //}
                //else
                //{
                //    reportDocument.OpenSubreport("rebate").SetDataSource(dtSub);
                //}

                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "Requisition Report" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
Example #3
0
        public void GetInternalEmiInvoiceReport(int internal_requisition_master_id, int user_id)
        {
            try
            {
                var    wbClient       = new WebClient();
                string downloadString = CoreRules.httpRequest() + "InternalEmiRequisition/GetInternalEmiInvoiceReport?internal_requisition_master_id=" + internal_requisition_master_id + "&user_id=" + user_id;
                var    apidata        = wbClient.DownloadString(downloadString);
                InternalEmiCombinedInvoiceReportModel oDeliAndDis = JsonConvert.DeserializeObject <InternalEmiCombinedInvoiceReportModel>(apidata);
                DataTable dt1 = ToDataTable(oDeliAndDis.InternalInvoiceReportModel);


                using (var reportDocument = new ReportDocument())
                {
                    reportDocument.Load(Server.MapPath("~/Reports/crystal_view/InternalEmiInvoiceReportData.rpt"));
                    reportDocument.SetDataSource(oDeliAndDis.InternalInvoiceReportModel);

                    if (oDeliAndDis.InstallmentDetailsModel.Count > 0)
                    {
                        reportDocument.OpenSubreport("installmentDetailsSubRpt").SetDataSource(oDeliAndDis.InstallmentDetailsModel);
                    }
                    else
                    {
                        reportDocument.OpenSubreport("installmentDetailsSubRpt").SetDataSource(dt1); //if assign list and list is empty then it showing error
                    }

                    reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "Invoice_" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public ActionResult Cancel(int delivery_master_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "EshopRequisition/CancelEshopRequisition?delivery_master_id=" + delivery_master_id;
            string    apidata        = wbClient.DownloadString(downloadString);

            return(RedirectToAction("Index"));
        }
        public void GetAllDeliveredIMEIExcel()
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Inventory/GetAllDeliveredIMEIExcel";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <AllDeliveredIMEI> oAllDeliveredImeis = JsonConvert.DeserializeObject <List <AllDeliveredIMEI> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/AllDeliveredIMEI.rpt"));
                reportDocument.SetDataSource(oAllDeliveredImeis);
                reportDocument.ExportToHttpResponse(ExportFormatType.ExcelWorkbook, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetAllInventoryStockIMEIExcel(long product_id, long color_id, long product_version_id, long warehouse_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Inventory/GetAllInventoryStockExcel?product_id=" + product_id + "&color_id=" + color_id + "&warehouse_id=" + warehouse_id + "&product_version_id=" + product_version_id;
            string    apidata        = wbClient.DownloadString(downloadString);
            List <InventoryStockExcelModel> oDeliAndDis = JsonConvert.DeserializeObject <List <InventoryStockExcelModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/InventoryIMEIExcelReport.rpt"));
                reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.ExportToHttpResponse(ExportFormatType.ExcelWorkbook, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        //grn Excel with details IMEI-------
        public void GetGrnExcelReportByGrnMasterIdProductIdColorId(int grn_master_id, int product_id, int color_id)
        {
            WebClient             wbClient       = new WebClient();
            string                downloadString = CoreRules.httpRequest() + "Grn/GetGrnExcelReportByGrnMasterIdProductIdColorId?grn_master_id=" + grn_master_id + "&product_id=" + product_id + "&color_id=" + color_id;
            string                apidata        = wbClient.DownloadString(downloadString);
            List <GrnReportModel> oDeliAndDis    = JsonConvert.DeserializeObject <List <GrnReportModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/GrnExcelReport.rpt"));
                reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.ExportToHttpResponse(ExportFormatType.ExcelRecord, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
Example #8
0
        public void GetTransferOrderReport(int transfer_order_master_id)
        {
            WebClient            wbClient       = new WebClient();
            string               downloadString = CoreRules.httpRequest() + "TransferOrder/GetTransferOrderReportById?transfer_order_master_id=" + transfer_order_master_id;
            string               apidata        = wbClient.DownloadString(downloadString);
            List <ToReportModel> oDeliAndDis    = JsonConvert.DeserializeObject <List <ToReportModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/ToReport.rpt"));
                reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetAdaProductInventoryAllExcel()
        {
            WebClient             wbClient       = new WebClient();
            string                downloadString = CoreRules.httpRequest() + "Inventory/GetAdaProductInventoryAllExcel";
            string                apidata        = wbClient.DownloadString(downloadString);
            List <GrnReportModel> oDeliAndDis    = JsonConvert.DeserializeObject <List <GrnReportModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/GrnExcelReport.rpt"));
                reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.ExportToHttpResponse(ExportFormatType.ExcelRecord, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
Example #10
0
        public void BestSellingProductsReport(DateTime from_date, DateTime to_date)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "/Dashboard/BestSellingProductsReport?from_date=" + from_date + "&to_date=" + to_date;
            string    apidata        = wbClient.DownloadString(downloadString);
            List <BestSellingProductsReportModel> oDeliAndDis = JsonConvert.DeserializeObject <List <BestSellingProductsReportModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/BestSellingProductReport.rpt"));
                reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetMonthlyTransferReport(DateTime from_date, DateTime to_date, long from_warehouse_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "/ToDelivery/GetMonthlyTransferReport?from_date=" + from_date + "&to_date=" + to_date + "&from_warehouse_id=" + from_warehouse_id;
            string    apidata        = wbClient.DownloadString(downloadString);
            List <MonthlyTransferReportModel> oDeliAndDis = JsonConvert.DeserializeObject <List <MonthlyTransferReportModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/MonthlyTransferReport.rpt"));
                reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetPartyWiseInventoryDetailsExcel(int product_id, int color_id, int warehouse_id, int party_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Inventory/GetPartyWiseInventoryDetailsExcel?product_id=" + product_id + "&color_id=" + color_id + "&warehouse_id=" + warehouse_id + "&party_id=" + party_id;
            string    apidata        = wbClient.DownloadString(downloadString);
            List <partyWiseStockExcelReportModel> objPartyWiseInventoryDetails = JsonConvert.DeserializeObject <List <partyWiseStockExcelReportModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/partyWiseStockExcelReport.rpt"));
                reportDocument.SetDataSource(objPartyWiseInventoryDetails);
                reportDocument.ExportToHttpResponse(ExportFormatType.ExcelRecord, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetPartyWiseStockReport(int party_id, int user_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Inventory/PartyWiseStockReport?party_id=" + party_id + "&user_id=" + user_id + " ";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <InventoryStockModel> objInventoryStock = JsonConvert.DeserializeObject <List <InventoryStockModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/PartyWiseStockReport.rpt"));

                reportDocument.SetDataSource(objInventoryStock);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        //invoice wise imei
        public void GetInvoiceWiseImeiReportPDF(long InvoiceMasterId)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Report/GetInvoiceWiseImeiReportPDF?InvoiceMasterId=" + InvoiceMasterId + " ";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <InvoiceWiseImeiModel> objDailySalesTransaction = JsonConvert.DeserializeObject <List <InvoiceWiseImeiModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/InvoiceWiseImei.rpt"));

                reportDocument.SetDataSource(objDailySalesTransaction);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetDailySalesReportPDF(string fromDate, string toDate, long productCategoryId, long productId)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Report/GetDailySalesReportPDF?fromDate=" + fromDate + "&toDate=" + toDate + "&productCategoryId=" + productCategoryId + "&productId=" + productId + "";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <DailySalesReportModel> objDailySalesTransaction = JsonConvert.DeserializeObject <List <DailySalesReportModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/DailySalesReport.rpt"));

                reportDocument.SetDataSource(objDailySalesTransaction);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetPurchaseOrderListPdf(string from_date, string to_date)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "PurchaseOrder/GetPurchaseOrderExcelData?from_date=" +
                                       from_date + "&to_date=" + to_date + "";
            string apidata = wbClient.DownloadString(downloadString);
            List <PurchaseOrderExcelModel> oDeliAndDis = JsonConvert.DeserializeObject <List <PurchaseOrderExcelModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/PoSummeryReport.rpt"));
                reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetSalableAndNonSalableStock()
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Report/GetSalableAndNonSalableStock";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <SalableAndNonSalableStockModel> objSalableQuantity = JsonConvert.DeserializeObject <List <SalableAndNonSalableStockModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/SalableNonSalableQuantity.rpt"));

                reportDocument.SetDataSource(objSalableQuantity);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetInventoryReport(int warehouse_id, int product_id, int color_id, string from_date, string to_date, int user_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Inventory/GetInventoryReport?warehouse_id=" + warehouse_id + "&product_id=" + product_id + "&color_id=" + color_id + "&from_date=" + from_date + "&to_date=" + to_date + "&user_id=" + user_id + "";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <InventoryReportModels> objInventory = JsonConvert.DeserializeObject <List <InventoryReportModels> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/InventoryReport.rpt"));

                reportDocument.SetDataSource(objInventory);
                reportDocument.ExportToHttpResponse(ExportFormatType.ExcelWorkbook, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
Example #19
0
        public void GetPaymentHistoryReport(string from_date, string to_date)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Receive/GetPaymentHistory?from_date=" + from_date + "&to_date=" + to_date + "";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <PaymentHistoryModel> objPaymentHistory = JsonConvert.DeserializeObject <List <PaymentHistoryModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/PaymentHistory.rpt"));

                reportDocument.SetDataSource(objPaymentHistory);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetRetailerDeliveryInformationPdf(string from_date, string to_date, int party_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "RetailerDelivery/GetRetailerDeliveryformation?from_date=" +
                                       from_date + "&to_date=" + to_date + "&party_id=" + party_id + "";
            string apidata = wbClient.DownloadString(downloadString);
            List <RetailerDeliveryInfoModel> oDeliAndDis = JsonConvert.DeserializeObject <List <RetailerDeliveryInfoModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/RetailerDeliveryInfoReport.rpt"));
                reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
Example #21
0
        public void GetMoneyReceiptReport(int receive_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Receive/GetMoneyReceiptReport?receive_id=" + receive_id;
            string    apidata        = wbClient.DownloadString(downloadString);
            List <MoneyReceiptModelsOfReceiveReport> objMoneyReceipt = JsonConvert.DeserializeObject <List <MoneyReceiptModelsOfReceiveReport> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/ReceiveReport.rpt"));

                reportDocument.SetDataSource(objMoneyReceipt);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
Example #22
0
        public void GetProductLiftingAndPaymentSummeryDetailsReport(string from_date, string to_date, int party_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Receive/ProductLiftingAndPaymentSummery?from_date=" + from_date + "&to_date=" + to_date + "&party_id=" + party_id + "";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <ProductLiftingAndPaymentSummery> LiftingAndPayment = JsonConvert.DeserializeObject <List <ProductLiftingAndPaymentSummery> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/ProductLiftingAndPaymentSummeryDetails.rpt"));

                reportDocument.SetDataSource(LiftingAndPayment);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void AccountsReportPDF(string fromDate, string toDate, long partyTypeId, long partyId, string receivedInvoiceNo)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Report/GetAccountsReport?fromDate=" + fromDate + "&toDate=" + toDate + "&partyTypeId=" + partyTypeId + "&partyId=" + partyId + "&receivedInvoiceNo=" + receivedInvoiceNo + "";
            string    apidata        = wbClient.DownloadString(downloadString);
            List <AccountsReportModel> objAccountsReportModel = JsonConvert.DeserializeObject <List <AccountsReportModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/AccountsReport.rpt"));

                reportDocument.SetDataSource(objAccountsReportModel);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        // PSI Details PDF
        public void GetPSIDetailsPdf(string from_date, string to_date, string product_id, string color_id)
        {
            WebClient wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "Inventory/PSIDetails?from_date=" +
                                       from_date + "&to_date=" + to_date + "&product_id=" + product_id + "&color_id=" +
                                       color_id + "";
            string apidata = wbClient.DownloadString(downloadString);
            List <PSIDetailsModel> objPSIPdf = JsonConvert.DeserializeObject <List <PSIDetailsModel> >(apidata);


            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/PSIDetailsPDF.rpt"));
                reportDocument.SetDataSource(objPSIPdf);
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
Example #25
0
        public void GetInternalEmiDeliveryReport(int delivery_master_id, int user_id)
        {
            var       wbClient       = new WebClient();
            string    downloadString = CoreRules.httpRequest() + "InternalEmiRequisition/GetInternalEmiDeliveryReportById?delivery_master_id=" + delivery_master_id + "&user_id=" + user_id;
            var       apidata        = wbClient.DownloadString(downloadString);
            var       oDeliAndDis    = JsonConvert.DeserializeObject <List <DeliveryReportModel> >(apidata);
            DataTable dt             = ToDataTable(oDeliAndDis);

            using (var reportDocument = new ReportDocument())
            {
                reportDocument.Load(Server.MapPath("~/Reports/crystal_view/InternalEmiDeliveryReport.rpt"));
                //reportDocument.SetDataSource(oDeliAndDis);
                reportDocument.SetDataSource(dt);
                reportDocument.SummaryInfo.ReportTitle   = "Delivery Challan";
                reportDocument.SummaryInfo.ReportSubject = "Delivery Challan";
                reportDocument.SummaryInfo.ReportAuthor  = "ADA SCM System";
                reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "Delivery_Challan_" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
            }
        }
        public void GetPartyJournalReport(int party_id, DateTime from_date, DateTime to_date)
        {
            try
            {
                WebClient wbClient       = new WebClient();
                string    downloadString = CoreRules.httpRequest() + "PartyJournal/GetPartyJournalReportById?party_id=" + party_id + "&from_date=" + from_date + "&to_date=" + to_date + "";
                string    apidata        = wbClient.DownloadString(downloadString);
                List <PartyJournalReportModel> oDeliAndDis = JsonConvert.DeserializeObject <List <PartyJournalReportModel> >(apidata);


                using (var reportDocument = new ReportDocument())
                {
                    reportDocument.Load(Server.MapPath("~/Reports/crystal_view/PartyJournalReport.rpt"));
                    reportDocument.SetDataSource(oDeliAndDis);
                    reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "Party Journal Report" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #27
0
        public void GetOnlineDeliveryChallanReport(int delivery_master_id)
        {
            try
            {
                WebClient wbClient       = new WebClient();
                string    downloadString = CoreRules.httpRequest() + "OnlineRequisition/GetOnlineDeliveryChallanReport?deliveryMasterId=" + delivery_master_id;
                string    apidata        = wbClient.DownloadString(downloadString);
                List <OnlineDeliveryChallanModel> oDeliAndDis = JsonConvert.DeserializeObject <List <OnlineDeliveryChallanModel> >(apidata);


                using (var reportDocument = new ReportDocument())
                {
                    reportDocument.Load(Server.MapPath("~/Reports/crystal_view/OnlineDeliveryReport.rpt"));
                    reportDocument.SetDataSource(oDeliAndDis);
                    reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "Lot No Print Report" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public ActionResult RedrictToLogin()
        {
            string userid = (string)Session["user_au_id"];

            // Calling Api For sending User_id
            if (userid != null)
            {
                WebClient wbClient       = new WebClient();
                string    downloadString = CoreRules.httpRequest() + "LoginLog/LogOutInfoEntry?userId=" +
                                           userid + "";
                string apidata = wbClient.DownloadString(downloadString);
                //Closing Api Connection before Session Abandon

                Session.Clear();
                Session.Abandon();
                return(Redirect("/login/Index"));
            }


            Session.Clear();
            Session.Abandon();
            return(Redirect("/login/Index"));
        }
Example #29
0
        public void GetReturnReport(int return_master_id)
        {
            try
            {
                WebClient wbClient = new WebClient();
                //string downloadString = CoreRules.httpRequest() + "Return/GetReturnReport?return_master_id=" + return_master_id + "";//
                string downloadString = CoreRules.httpRequest() + "Return/ReturnInvoiceReportById?return_master_id=" + return_master_id + "";
                string apidata        = wbClient.DownloadString(downloadString);
                List <ReturnReportModel> oDeliAndDis = JsonConvert.DeserializeObject <List <ReturnReportModel> >(apidata);


                using (var reportDocument = new ReportDocument())
                {
                    reportDocument.Load(Server.MapPath("~/Reports/crystal_view/ReturnInvoice.rpt"));
                    reportDocument.SetDataSource(oDeliAndDis);
                    reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "Return Invoice" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //public static DataTable ToDataTable<T>(this IList<T> data)
        //{
        //    PropertyDescriptorCollection props =
        //        TypeDescriptor.GetProperties(typeof(T));
        //    DataTable table = new DataTable();
        //    for (int i = 0; i < props.Count; i++)
        //    {
        //        PropertyDescriptor prop = props[i];
        //        table.Columns.Add(prop.Name, prop.PropertyType);
        //    }
        //    object[] values = new object[props.Count];
        //    foreach (T item in data)
        //    {
        //        for (int i = 0; i < values.Length; i++)
        //        {
        //            values[i] = props[i].GetValue(item);
        //        }
        //        table.Rows.Add(values);
        //    }
        //    return table;
        //}
        public void GetInvoiceReport(int invoice_master_id)
        {
            try
            {
                DataSet ds = new DataSet();

                WebClient wbClient       = new WebClient();
                string    downloadString = CoreRules.httpRequest() + "Invoice/GetInvoiceReportById?invoice_master_id=" + invoice_master_id + " ";
                string    apidata        = wbClient.DownloadString(downloadString);
                //List<InvoiceReportModel> oDeliAndDis = JsonConvert.DeserializeObject<List<InvoiceReportModel>>(apidata);//original code
                InvoiceCombinedModelcs oDeliAndDis = JsonConvert.DeserializeObject <InvoiceCombinedModelcs>(apidata);//19.09.2016

                //////////////////////////////////////////////
                //DataTable dt1 = ToDataTable(oDeliAndDis.InvoiceReportModels);//19.09.2016
                //DataTable dt2 = ToDataTable(oDeliAndDis.RebateReportModels);//19.09.2016
                DataTable dt3 = ToDataTable(oDeliAndDis.ReceivedBreakdownModels);

                //dt1.Merge(dt2);
                //dt1.AcceptChanges();

                //ds.Merge(dt1);


                /////////////////////////////////////////////


                using (var reportDocument = new ReportDocument())
                {
                    reportDocument.Load(Server.MapPath("~/Reports/crystal_view/Invoice.rpt"));
                    //reportDocument.SetDataSource(oDeliAndDis);//original code
                    reportDocument.SetDataSource(oDeliAndDis.InvoiceReportModels);


                    //rebate subreport
                    //if (oDeliAndDis.RebateReportModels.Count>0)
                    //{
                    //    reportDocument.OpenSubreport("rebate").SetDataSource(oDeliAndDis.RebateReportModels);
                    //}
                    //else
                    //{
                    //    reportDocument.OpenSubreport("rebate").SetDataSource(dt2);
                    //}

                    //comments on 17.04.2017-mohi uddin
                    //received breakdown subreport
                    //if (oDeliAndDis.ReceivedBreakdownModels.Count > 0)
                    //{
                    //    reportDocument.OpenSubreport("receivedbreakdown").SetDataSource(oDeliAndDis.ReceivedBreakdownModels);
                    //}
                    //else
                    //{
                    //    reportDocument.OpenSubreport("receivedbreakdown").SetDataSource(dt3);//if assign list and list is empty then it showing error
                    //}

                    reportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, "Invoice Report" + DateTime.Now.ToString("dd-MM-yyyy_hh-mm_tt"));
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }