示例#1
0
        public string ExportCSVTranscationsReport(ViewTransactionCBE transaction)
        {
            Int16    IsDataFound = 0;
            var      filename    = "TransactionDetails_" + DateTime.Now.ToString(Constants.dateTimeFormat24HForFileName) + ".csv";
            FileInfo file        = new FileInfo(Server.MapPath("~/Attachment/ExportFiles/" + filename));

            try
            {
                string strstarttime = Convert.ToDateTime(transaction.StartDate).ToString("dd/MM/yyyy HH:mm:ss");
                string strendtime   = Convert.ToDateTime(transaction.EndDate).ToString("dd/MM/yyyy HH:mm:ss");

                IsDataFound = CSVUtility.CreateCsv(file.FullName, TransactionBLL.TransDeatilsReport(strstarttime, strendtime));
                if (IsDataFound == 0)
                {
                    filename = "No Data to Export.";
                }
            }
            catch (Exception ex)
            {
                HelperClass.LogMessage("Failed Export Transaction Details_ CSV " + ex);
            }
            string Det = JsonConvert.SerializeObject(filename, Formatting.Indented);

            return(Det.Replace("\r", "").Replace("\n", ""));
        }
        public string DashBoardTransactionData(ViewTransactionCBE transaction)
        {
            string result = "";

            string strstarttime = Convert.ToDateTime(transaction.StartDate).ToString("dd/MM/yyyy HH:mm:ss");
            string strendtime   = Convert.ToDateTime(transaction.EndDate).ToString("dd/MM/yyyy HH:mm:ss");
            string Det          = JsonConvert.SerializeObject(TransactionBLL.TransDeatilsReport(strstarttime, strendtime), Formatting.Indented);

            result = Det.Replace("\r", "").Replace("\n", "");
            return(result);
        }