Ejemplo n.º 1
0
        public async Task <JsonResult> List(DataTableRequest request)
        {
            List <AssestsRequest> _requests = await db.AssestsRequests.Where(r => (r.HasApproved || r.HasRejected)).ToListAsync();

            foreach (AssestsRequest _item in _requests)
            {
                if (_item.UserID == AppManager.User.ID)
                {
                    _item.HasRejected = false;
                    _item.HasApproved = false;

                    await db.SaveChangesAsync();
                }
            }

            var _query = from r in db.AssestsRequests
                         select new
            {
                r.ID,
                r.UserID,
                r.Assest,
                r.Quantity,
                r.CreatedOn,
                r.StatusChangedOn,
                r.User,
                r.Status
            };

            if (!string.IsNullOrEmpty(request.sSearch))
            {
                _query = _query.Where(r => r.User.NickName.Contains(request.sSearch) || r.User.Username.Contains(request.sSearch) || r.CreatedOn.ToString().Contains(request.sSearch) || r.StatusChangedOn.ToString().Contains(request.sSearch) || r.Assest.Contains(request.sSearch));
            }

            if (!AppManager.User.IsSuperAdmin)
            {
                _query = _query.Where(i => i.UserID == AppManager.User.ID);
            }

            switch (request.iSortCol_0)
            {
            case 0:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(r => (string.IsNullOrEmpty(r.User.NickName) ? r.User.Username : r.User.NickName)) : _query.OrderBy(r => (string.IsNullOrEmpty(r.User.NickName) ? r.User.Username : r.User.NickName));
                break;

            case 1:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(r => r.Assest) : _query.OrderByDescending(r => r.Assest);
                break;

            case 2:
                _query = request.sSortDir_0 == "asc" ? _query.OrderByDescending(r => r.Quantity) : _query.OrderBy(r => r.Quantity);
                break;

            case 3:
                _query = request.sSortDir_0 == "asc" ? _query.OrderByDescending(r => r.Status) : _query.OrderBy(r => r.Status);
                break;

            case 4:
                _query = request.sSortDir_0 == "asc" ? _query.OrderByDescending(r => r.CreatedOn) : _query.OrderBy(r => r.CreatedOn);
                break;

            case 5:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(r => r.StatusChangedOn) : _query.OrderByDescending(r => r.StatusChangedOn);
                break;

            default:
                _query = _query.OrderByDescending(r => r.ID);
                break;
            }

            var _count = await _query.CountAsync();

            var _data = await _query.Skip(request.iDisplayStart).Take(request.iDisplayLength).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row = new DataTableRow();

                _row.Add(_rowData.User.NickName == null ? "@" + _rowData.User.Username : _rowData.User.NickName);
                _row.Add(_rowData.Assest);
                _row.Add(String.Format("{0:0.00000000}", _rowData.Quantity));

                switch (_rowData.Status)
                {
                case "Pending":
                    if (!AppManager.User.IsSuperAdmin)
                    {
                        _row.Add(@"<span class='label label-primary'>" + _rowData.Status + "</span>");
                    }
                    else
                    {
                        _row.Add(@"<span class='label label-primary'>" + _rowData.Status + "</span><div><span>");
                    }
                    break;

                case "Rejected":
                    _row.Add(@"<span class='label label-danger'>" + _rowData.Status + "</span>");
                    break;

                case "Approved":
                    _row.Add(@"<span class='label label-success'>" + _rowData.Status + "</span>");
                    break;
                }

                _row.Add(_rowData.CreatedOn.ToString("dd/MM/yyyy hh:mm tt"));
                _row.Add(_rowData.StatusChangedOn != null ? _rowData.CreatedOn.ToString("dd/MM/yyyy hh:mm tt") : "-");

                if (_rowData.Status == "Pending" && AppManager.User.IsSuperAdmin)
                {
                    _row.Add(@"<a href='/wallet/approve/" + _rowData.ID + "'><i class='confirm mr5' title='Approve' data-confirm='Are you sure you want to approve this Request?'><i class='icon-checkmark4 text-primary'></i></i></a>  <a href='/wallet/reject/" + _rowData.ID + "'><i class='confirm mr5' title='Reject' data-confirm='Are you sure you want to reject this Request?'><i class='icon-cross2 text-primary'></i></i></a></span><div>");
                }
                else
                {
                    _row.Add("N/A");
                }

                _rows.Add(_row);
            }

            return(Json(new DataTableResponse
            {
                sEcho = request.sEcho,
                iDisplayLength = request.iDisplayLength,
                iTotalRecords = _count,
                iDisplayStart = request.iDisplayStart,
                iTotalDisplayRecords = _count,
                aaData = _rows
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public async Task <JsonResult> HistoryList(DataTableRequest request, int ID)
        {
            var _query = db.AdministratorSessions.Where(a => a.AdministratorID == ID).Select(a => new
            {
                a.StartTime,
                a.EndTime,
                a.IPAddress,
                a.UserAgent,
                a.ID,
                a.AdministratorID
            });

            if (!string.IsNullOrEmpty(request.sSearch))
            {
                _query = _query.Where(a => a.IPAddress.Contains(request.sSearch) || a.UserAgent.Contains(request.sSearch) || a.StartTime.ToString().Contains(request.sSearch) || a.EndTime.ToString().Contains(request.sSearch));
            }

            switch (request.iSortCol_0)
            {
            case 0:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.IPAddress) : _query.OrderByDescending(a => a.IPAddress);
                break;

            case 1:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.UserAgent) : _query.OrderByDescending(a => a.UserAgent);
                break;

            case 2:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.StartTime) : _query.OrderByDescending(a => a.StartTime);
                break;

            case 3:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.EndTime) : _query.OrderByDescending(a => a.EndTime);
                break;

            default:
                _query = _query.OrderByDescending(a => a.ID);
                break;
            }

            int _count = await _query.CountAsync();

            var data = await _query.Skip(request.iDisplayStart).Take(request.iDisplayLength).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in data)
            {
                DataTableRow _row = new DataTableRow();

                if (_rowData.IPAddress != null)
                {
                    _row.Add(_rowData.IPAddress);
                }
                else
                {
                    _row.Add("-");
                }

                if (_rowData.UserAgent != null)
                {
                    _row.Add(@"<span data-toggle='popover' data-trigger='hover' data-content='" + _rowData.UserAgent + "' data-placement='top' data-container='body' data-animation='true'>" + _rowData.UserAgent.Remove(20) + "...</span>");
                }
                else
                {
                    _row.Add("-");
                }

                _row.Add(_rowData.StartTime.ToString("dd MMMM, yyyy hh:mm:ss tt"));
                _row.Add(_rowData.EndTime == null ? _rowData.StartTime.AddMinutes(20).ToString("dd MMMM, yyyy hh:mm:ss tt") : _rowData.EndTime.Value.ToString("dd MMMM, yyyy hh:mm:ss tt"));
                _row.Add(AppManager.FormattedDuration(_rowData.EndTime != null ? _rowData.EndTime.Value.Subtract(_rowData.StartTime) : _rowData.StartTime.AddMinutes(20).Subtract(_rowData.StartTime)));

                _rows.Add(_row);
            }
            return(Json(new DataTableResponse
            {
                sEcho = request.sEcho,
                iDisplayLength = request.iDisplayLength,
                iTotalRecords = _count,
                iDisplayStart = request.iDisplayStart,
                iTotalDisplayRecords = _count,
                aaData = _rows
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 3
0
        public async Task <JsonResult> List(DataTableRequest request, string daterange)
        {
            var _query = from o in db.Offers
                         where o.IsDataActive
                         select new
            {
                o.ID,
                o.Title,
                o.Discount,
                o.LastDate,
                o.LastUpdatedOn,
                o.CreatedByID,
                o.LastUpdatedByID,
                CreatedBy = db.Administrators.FirstOrDefault(a => a.IsDataActive && a.ID == o.CreatedByID).Name,
                EditedBy  = db.Administrators.FirstOrDefault(a => a.IsDataActive && a.ID == o.LastUpdatedByID).Name
            };

            if (!string.IsNullOrEmpty(daterange))
            {
                string[] _daterange = daterange.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                DateTime?_start     = Convert.ToDateTime(_daterange[0], new CultureInfo("en-CA"));
                DateTime?_end       = Convert.ToDateTime(_daterange[2], new CultureInfo("en-CA"));
                _end   = _end.Value.AddDays(1);
                _query = _query.Where(o => o.LastUpdatedOn >= _start.Value && o.LastUpdatedOn < _end.Value);
            }

            if (!string.IsNullOrEmpty(request.sSearch))
            {
                _query = _query.Where(o => o.Title.Contains(request.sSearch) || o.Discount.ToString().Contains(request.sSearch) || o.LastDate.ToString().Contains(request.sSearch) || o.CreatedBy.ToString().Contains(request.sSearch) || o.EditedBy.ToString().Contains(request.sSearch) || o.LastUpdatedOn.ToString().Contains(request.sSearch));
            }

            switch (request.iSortCol_0)
            {
            case 0:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(o => o.Title) : _query.OrderByDescending(o => o.Title);
                break;

            case 1:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(o => o.Discount) : _query.OrderByDescending(o => o.Discount);
                break;

            case 2:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(o => o.CreatedBy) : _query.OrderByDescending(o => o.CreatedBy);
                break;

            case 3:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(o => o.EditedBy) : _query.OrderByDescending(o => o.EditedBy);
                break;

            case 4:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(o => o.LastDate) : _query.OrderByDescending(o => o.LastDate);
                break;

            case 5:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(o => o.LastUpdatedOn) : _query.OrderByDescending(o => o.LastUpdatedOn);
                break;

            default:
                _query = _query.OrderByDescending(o => o.ID);
                break;
            }

            int _count = await _query.CountAsync();

            var _data = await _query.Skip(request.iDisplayStart).Take(request.iDisplayLength).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row = new DataTableRow();

                _row.Add(_rowData.Title);
                _row.Add(_rowData.Discount);

                if (AppManager.Administrator.IsSuperAdmin || AppManager.Administrator.ID == _rowData.CreatedByID)
                {
                    _row.Add(@"<a href='/L0C5A3E8915871B710C2CC98073748424/administrators/details/" + _rowData.CreatedByID + "'>" + _rowData.CreatedBy + "</a>");
                }
                else
                {
                    _row.Add(_rowData.CreatedBy);
                }

                if (AppManager.Administrator.IsSuperAdmin || AppManager.Administrator.ID == _rowData.LastUpdatedByID)
                {
                    _row.Add(@"<a href='/L0C5A3E8915871B710C2CC98073748424/administrators/details/" + _rowData.LastUpdatedByID + "'>" + _rowData.EditedBy + "</a>");
                }
                else
                {
                    _row.Add(_rowData.EditedBy);
                }

                _row.Add(_rowData.LastDate.ToShortDateString());
                _row.Add(_rowData.LastUpdatedOn.ToString());

                _row.Add(@"<a href='/L0C5A3E8915871B710C2CC98073748424/offers/edit/" + _rowData.ID + "' title='Edit' class='mr5'><i class='icon-pencil7'></i></a>  <a class='confirm' data-confirm='Are you sure you want to delete this Offer?' href='/L0C5A3E8915871B710C2CC98073748424/offers/delete/" + _rowData.ID + "' title='Delete'><i class='icon-cancel-square'></i></a> ");

                _rows.Add(_row);
            }

            return(Json(new DataTableResponse
            {
                sEcho = request.sEcho,
                iDisplayLength = request.iDisplayLength,
                iTotalRecords = _count,
                iDisplayStart = request.iDisplayStart,
                iTotalDisplayRecords = _count,
                aaData = _rows
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public async Task <JsonResult> List(DataTableRequest request, string daterange)
        {
            var _query = from i in db.Investments
                         join u in db.Users on i.UserID equals u.ID
                         select new
            {
                i.ID,
                i.Mode,
                i.Amount,
                i.Status,
                i.InitializedOn,
                i.LastUpdatedOn,
                i.TxRefNoUpdatedOn,
                i.TxReferenceNumber,
                i.UserID,
                i.Token,
                i.Type,
                i.HasTransferred,
                i.TokenAmount
                ,
                i.ReceivedAmount
            };

            if (!string.IsNullOrEmpty(daterange))
            {
                string[] _daterange = daterange.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                DateTime?_start     = Convert.ToDateTime(_daterange[0], new CultureInfo("en-CA"));
                DateTime?_end       = Convert.ToDateTime(_daterange[2], new CultureInfo("en-CA"));
                _end   = _end.Value.AddDays(1);
                _query = _query.Where(u => u.LastUpdatedOn >= _start.Value && u.LastUpdatedOn < _end.Value);
            }

            _query = _query.Where(i => i.UserID == AppManager.User.ID);

            if (!string.IsNullOrEmpty(request.sSearch))
            {
                _query = _query.Where(u => u.LastUpdatedOn.ToString().Contains(request.sSearch) || u.InitializedOn.ToString().Contains(request.sSearch) || u.Type.ToString().Contains(request.sSearch) || u.Mode.Contains(request.sSearch) || u.Amount.ToString().Contains(request.sSearch) || u.Status.Contains(request.sSearch) || u.Token.ToString().Contains(request.sSearch));
            }

            switch (request.iSortCol_0)
            {
            case 1:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(i => i.Type) : _query.OrderByDescending(i => i.Type);
                break;

            case 3:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(i => i.Status) : _query.OrderByDescending(i => i.Status);
                break;

            case 4:
                _query = request.sSortDir_0 == "asc" ? _query.OrderByDescending(i => i.InitializedOn) : _query.OrderBy(i => i.InitializedOn);
                break;

            default:
                _query = _query.OrderByDescending(u => u.ID);
                break;
            }

            int _count = await _query.CountAsync();

            var _data = await _query.Skip(request.iDisplayStart).Take(request.iDisplayLength).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row        = new DataTableRow();
                string       _statusHtml = "";
                _row.Add($"<a href='/users/investments/details/{ _rowData.ID }' title='Details'>{_rowData.Token}</a>");
                _row.Add(_rowData.Type);

                switch (_rowData.Mode)
                {
                case "AUD":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "CAD":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "CHF":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "CNY":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "EUR":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "USD":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "GBP":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "JPY":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "SEK":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "NZD":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "MXN":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "SGD":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "HKD":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "NOK":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "KRW":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "TRY":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "RUB":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "INR":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "BRL":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                case "ZAR":
                    _row.Add($"{ String.Format("{0:0.00}", _rowData.Amount, MidpointRounding.AwayFromZero) } {_rowData.Mode}");
                    break;

                default:
                    _row.Add($"{_rowData.Amount} {_rowData.Mode}");
                    break;
                }

                switch (_rowData.Status)
                {
                case "Waiting for transaction reference number":
                case "Waiting for you to update your payment reference":
                    _statusHtml = $"<span class=\"label label-default\">Waiting for you to update your payment reference</span> [<a class='confirm' data-confirm='Please confirm your action as this could only be done once?' href='/users/investments/updatereferencenumber/{ _rowData.ID }' title='Confirm using your Wallet Address/ Bank Payment Reference'>Update</a>]";
                    break;

                case "Waiting for Confirmation":
                    _statusHtml = "<span class=\"label label-primary\">Waiting for Confirmation</span>";
                    break;

                case "Waiting for Wallet to be ready":
                case "Confirmed":
                    _statusHtml = $"<span class=\"label label-success\">Confirmed</span>";
                    break;
                //if (_rowData.WalletPassPhrase != null)
                //{
                //    _statusHtml =
                //        $"<span class=\"label label-success\">Waiting for Wallet to be ready</span> [<a href='/users/investments/printreceipt/{ _rowData.ID }' target='_blank' title='Add Wallet Password Phrase'>Download Receipt</a>]";
                //}
                //else
                //{
                //    _statusHtml = $"<span class=\"label label-success\">Confirmed</span> [<a href='/users/investments/addwalletpassphrase/{ _rowData.ID }' title='Add Wallet Password Phrase'>Update</a>] [<a href='/users/investments/printreceipt/{ _rowData.ID }' target='_blank' title='Add Wallet Password Phrase'>Download Receipt</a>]";
                //}
                //break;

                //case "Waiting for Wallet to be ready":
                //    _statusHtml = $"<span class=\"label label-success\">Waiting for Wallet to be ready</span> [<a href='/users/investments/printreceipt/{ _rowData.ID }' target='_blank' >Download Receipt</a>]";
                //    break;

                //case "Wallet Created":
                //    _statusHtml = $"<span class=\"label label-success\">Wallet Created</span> [<a href='/users/investments/download/{ _rowData.UserID }' target='_blank' >Download Wallet</a>]";
                //    break;
                case "Rejected":
                    _statusHtml = $"<span class=\"label label-danger\">Rejected</span>";
                    break;

                //case "Coins Issued":
                //    _statusHtml = $"<span class=\"label label-info\">Coins Issued</span> [<a href='/users/investments/download/{ _rowData.UserID }' target='_blank' >Download Wallet</a>]";
                //    break;
                default:
                    _statusHtml = "Unknown";
                    break;
                }

                if (_rowData.Type == "Growth Token" && _rowData.Status == "Confirmed" && _rowData.HasTransferred == true)
                {
                    _statusHtml = $"<span class='label label-success'>YOUR {_rowData.ReceivedAmount} SER TOKENS HAVE NOW BEEN TRANSFERRED TO THE GROWTH TOKEN CRYPTOFUND</span>";
                }
                else if (_rowData.Type == "Growth Token" && _rowData.Status == "Confirmed")
                {
                    _statusHtml = "<span class='label label-success1'>INVESTMENT CONFIRMED, PENDING TRANSFER TO THE GROWTH TOKEN CRYPTOFUND</span>";
                }

                _row.Add(_statusHtml);
                _row.Add(_rowData.InitializedOn.ToString());
                _rows.Add(_row);
            }

            return(Json(new DataTableResponse
            {
                sEcho = request.sEcho,
                iDisplayLength = request.iDisplayLength,
                iTotalRecords = _count,
                iDisplayStart = request.iDisplayStart,
                iTotalDisplayRecords = _count,
                aaData = _rows
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public async Task <JsonResult> List(DataTableRequest request, string daterange)
        {
            var _query = from a in db.Administrators
                         where a.IsDataActive
                         select new
            {
                a.ID,
                a.IsSuperAdmin,
                a.Email,
                a.AuthString,
                a.Name,
                a.Phone,
                a.IsActive,
                a.LastUpdatedOn,
            };

            if (!string.IsNullOrEmpty(daterange))
            {
                string[] _daterange = daterange.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                DateTime?_start     = Convert.ToDateTime(_daterange[0], new CultureInfo("en-CA"));
                DateTime?_end       = Convert.ToDateTime(_daterange[2], new CultureInfo("en-CA"));
                _end   = _end.Value.AddDays(1);
                _query = _query.Where(a => a.LastUpdatedOn >= _start.Value && a.LastUpdatedOn < _end.Value);
            }

            if (!AppManager.Administrator.IsSuperAdmin)
            {
                _query = _query.Where(a => a.ID == AppManager.Administrator.ID);
            }

            if (!string.IsNullOrEmpty(request.sSearch))
            {
                _query = _query.Where(a => a.Name.Contains(request.sSearch) || a.Email.Contains(request.sSearch) || a.Phone.Contains(request.sSearch) || (a.IsActive ? "Yes" : "No").Contains(request.sSearch) || (a.IsSuperAdmin ? "Yes" : "No").Contains(request.sSearch) || a.LastUpdatedOn.ToString().Contains(request.sSearch));
            }

            switch (request.iSortCol_0)
            {
            case 0:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.Name) : _query.OrderByDescending(a => a.Name);
                break;

            case 1:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.Email) : _query.OrderByDescending(a => a.Email);
                break;

            case 2:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.Phone) : _query.OrderByDescending(a => a.Phone);
                break;

            case 3:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.IsSuperAdmin) : _query.OrderByDescending(a => a.IsSuperAdmin);
                break;

            case 4:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.IsActive) : _query.OrderByDescending(a => a.IsActive);
                break;

            case 5:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(a => a.LastUpdatedOn) : _query.OrderByDescending(a => a.LastUpdatedOn);
                break;

            default:
                _query = _query.OrderByDescending(a => a.ID);
                break;
            }

            int _count = await _query.CountAsync();

            var _data = await _query.Skip(request.iDisplayStart).Take(request.iDisplayLength).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row = new DataTableRow();

                _row.Add(@"<a href='/L0C5A3E8915871B710C2CC98073748424/administrators/details/" + _rowData.ID + "'> " + _rowData.Name + " </a> ");
                _row.Add(_rowData.Email);
                _row.Add(!string.IsNullOrEmpty(_rowData.Phone) ? _rowData.Phone : "-");
                _row.Add(_rowData.IsSuperAdmin ? "<span class='label label-success'>Yes</span>" : "<span class='label label-warning'>No</span>");
                _row.Add(_rowData.IsActive ? "<span class='label label-success'>Yes</span>" : "<span class='label label-warning'>No</span>");
                _row.Add(_rowData.LastUpdatedOn.ToString("dd/MM/yyyy hh:mm tt"));

                if (AppManager.Administrator.ID == _rowData.ID)
                {
                    _row.Add(@"<a href='/L0C5A3E8915871B710C2CC98073748424/administrators/edit/" + _rowData.ID + "' title='Edit' class='mr5'><i class='icon-pencil7'></i></a>");
                }
                else
                {
                    _row.Add(@"<a href='/L0C5A3E8915871B710C2CC98073748424/administrators/edit/" + _rowData.ID + "' title='Edit' class='mr5'><i class='icon-pencil7'></i></a>  <a class='confirm' data-confirm='Are you sure you want to cancel this Administator?' href='/L0C5A3E8915871B710C2CC98073748424/administrators/delete/" + _rowData.ID + "' title='Cancel'><i class='icon-cancel-square'></i></a>");
                }

                _rows.Add(_row);
            }

            return(Json(new DataTableResponse
            {
                sEcho = request.sEcho,
                iDisplayLength = request.iDisplayLength,
                iTotalRecords = _count,
                iDisplayStart = request.iDisplayStart,
                iTotalDisplayRecords = _count,
                aaData = _rows
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        public async Task <JsonResult> List(DataTableRequest request, string daterange)
        {
            var _query = from i in db.Wallets
                         join u in db.Users on i.UserID equals u.ID
                         join a in db.Administrators on i.CreatedByID equals a.ID
                         where i.IsDataActive
                         select new
            {
                i.ID,
                i.Address,
                i.WalletFile,
                i.WalletHTMLFile,
                i.WalletImageFile,
                i.LastUpdatedOn,
                i.CreatedByID,
                u.LastName,
                u.Title,
                u.FirstName,
                a.Name,
                u.Email,
            };

            if (!string.IsNullOrEmpty(daterange))
            {
                string[] _daterange = daterange.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                DateTime?_start     = Convert.ToDateTime(_daterange[0], new CultureInfo("en-CA"));
                DateTime?_end       = Convert.ToDateTime(_daterange[2], new CultureInfo("en-CA"));
                _end   = _end.Value.AddDays(1);
                _query = _query.Where(u => u.LastUpdatedOn >= _start.Value && u.LastUpdatedOn < _end.Value);
            }

            if (!string.IsNullOrEmpty(request.sSearch))
            {
                _query = _query.Where(u => u.LastUpdatedOn.ToString().Contains(request.sSearch) || u.Address.Contains(request.sSearch) || u.Email.Contains(request.sSearch));
            }

            switch (request.iSortCol_0)
            {
            case 0:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(i => i.Email) : _query.OrderByDescending(i => i.Email);
                break;

            case 1:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(i => i.Address) : _query.OrderByDescending(i => i.Address);
                break;

            case 4:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(i => i.LastUpdatedOn) : _query.OrderByDescending(i => i.LastUpdatedOn);
                break;

            default:
                _query = _query.OrderByDescending(i => i.ID);
                break;
            }

            var _count = await _query.CountAsync();

            var _data = await _query.Skip(request.iDisplayStart).Take(request.iDisplayLength).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row = new DataTableRow();

                _row.Add(_rowData.Email);
                _row.Add(_rowData.Address);
                _row.Add(@"<a href='/uploads/" + _rowData.WalletFile + "' target=_blank>Download</a>");
                _row.Add(@"<a href='/uploads/" + _rowData.WalletHTMLFile + "' target=_blank>Download</a>");
                _row.Add(@"<a href='/uploads/" + _rowData.WalletImageFile + "' target=_blank>Download</a>");
                _row.Add(_rowData.LastUpdatedOn.ToString());
                _row.Add(@"<a href='/L0C5A3E8915871B710C2CC98073748424/wallets/details/" + _rowData.ID + "' title='Details' class='mr5'><i class='icon-magazine'></i></a>");

                _rows.Add(_row);
            }

            return(Json(new DataTableResponse
            {
                sEcho = request.sEcho,
                iDisplayLength = request.iDisplayLength,
                iTotalRecords = _count,
                iDisplayStart = request.iDisplayStart,
                iTotalDisplayRecords = _count,
                aaData = _rows
            }, JsonRequestBehavior.AllowGet));
        }
        public async Task <JsonResult> List(DataTableRequest request)
        {
            List <Request> _requests = await db.Requests.Where(r => r.IsDataActive && r.HasRejected).ToListAsync();

            foreach (Request _item in _requests)
            {
                if (_item.SenderID == AppManager.User.ID)
                {
                    _item.HasRejected = false;

                    await db.SaveChangesAsync();
                }
            }

            var _query = from r in db.Requests
                         where r.IsDataActive && r.SenderID == AppManager.User.ID || r.Recipient == AppManager.User.Email
                         select new
            {
                r.ID,
                r.Message,
                r.Status,
                r.SentOn,
                r.RespondedOn,
                r.SenderID,
                r.Recipient,
                r.HasDownloaded,
                r.User,
                Receiver = db.Users.FirstOrDefault(u => u.IsDataActive && (u.Email == r.Recipient || u.NickName == r.Recipient))
            };

            if (!string.IsNullOrEmpty(request.sSearch))
            {
                _query = _query.Where(r => r.User.NickName.Contains(request.sSearch) | r.User.Username.Contains(request.sSearch) || r.Recipient.Contains(request.sSearch) || r.SentOn.ToString().Contains(request.sSearch) || r.RespondedOn.ToString().Contains(request.sSearch) || r.Status.Contains(request.sSearch));
            }

            switch (request.iSortCol_0)
            {
            case 0:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(r => (string.IsNullOrEmpty(r.User.NickName) ? r.User.Username : r.User.NickName)) : _query.OrderByDescending(r => (string.IsNullOrEmpty(r.User.NickName) ? r.User.Username : r.User.NickName));
                break;

            case 1:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(r => (string.IsNullOrEmpty(r.Receiver.NickName) ? r.Receiver.Username : r.Receiver.NickName)) : _query.OrderByDescending(r => (string.IsNullOrEmpty(r.Receiver.NickName) ? r.Receiver.Username : r.Receiver.NickName));
                break;

            case 2:
                _query = request.sSortDir_0 == "asc" ? _query.OrderByDescending(r => r.SentOn) : _query.OrderBy(r => r.SentOn);
                break;

            case 3:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(r => r.RespondedOn) : _query.OrderByDescending(r => r.RespondedOn);
                break;

            case 4:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(r => r.Status) : _query.OrderByDescending(r => r.Status);
                break;

            default:
                _query = _query.OrderByDescending(r => r.ID);
                break;
            }

            var _count = await _query.CountAsync();

            var _data = await _query.Skip(request.iDisplayStart).Take(request.iDisplayLength).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row = new DataTableRow();

                _row.Add((string.IsNullOrEmpty(_rowData.User.NickName) ? "@" + _rowData.User.Username : _rowData.User.NickName));

                if (_rowData.Receiver != null)
                {
                    _row.Add((string.IsNullOrEmpty(_rowData.Receiver.NickName) ? "@" + _rowData.Receiver.Username : _rowData.Receiver.NickName));
                }
                else
                {
                    _row.Add("-");
                }
                _row.Add(_rowData.SentOn.ToString("dd/MM/yyyy hh:mm tt"));

                switch (_rowData.Status)
                {
                case "Pending":
                    _row.Add(@"<span class='label label-primary'>" + _rowData.Status + "</span>");
                    break;

                case "Rejected":
                    _row.Add(@"<span class='label label-danger'>" + _rowData.Status + "</span>");
                    break;

                case "Approved":
                    _row.Add(@"<span class='label label-success'>" + _rowData.Status + "</span>");
                    break;
                }

                if (_rowData.RespondedOn != null)
                {
                    _row.Add(_rowData.RespondedOn.Value.ToString("dd/MM/yyyy hh:mm tt"));
                }
                else
                {
                    _row.Add("-");
                }

                if (_rowData.Status == "Approved" && !_rowData.HasDownloaded && (_rowData.User.Email == AppManager.User.Email || _rowData.User.Username == AppManager.User.Username))
                {
                    _row.Add(@"<a href='/requests/details/" + _rowData.ID + "'><i class='icon-magazine text-primary'></i></a> | <a href='/pv/printpv/?email=" + _rowData.Recipient + "&id=" + _rowData.ID + "'><i class='icon-file-download2 text-primary'></i></a>");
                }
                else
                {
                    _row.Add(@"<a href='/requests/details/" + _rowData.ID + "'><i class='icon-magazine text-primary'></i></a>");
                }

                _rows.Add(_row);
            }

            return(Json(new DataTableResponse
            {
                sEcho = request.sEcho,
                iDisplayLength = request.iDisplayLength,
                iTotalRecords = _count,
                iDisplayStart = request.iDisplayStart,
                iTotalDisplayRecords = _count,
                aaData = _rows
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
0
        public async Task <JsonResult> List(DataTableRequest request, string daterange)
        {
            var _query = from u in db.Users
                         where u.IsDataActive
                         select new
            {
                u.ID,
                u.FirstName,
                u.Title,
                u.LastName,
                u.Position,
                u.Organization,
                u.Email,
                u.Phone,
                u.LastUpdatedOn,
                u.PostalCode
            };

            if (!string.IsNullOrEmpty(daterange))
            {
                string[] _daterange = daterange.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
                DateTime?_start     = Convert.ToDateTime(_daterange[0], new CultureInfo("en-CA"));
                DateTime?_end       = Convert.ToDateTime(_daterange[2], new CultureInfo("en-CA"));
                _end   = _end.Value.AddDays(1);
                _query = _query.Where(u => u.LastUpdatedOn >= _start.Value && u.LastUpdatedOn < _end.Value);
            }

            if (!string.IsNullOrEmpty(request.sSearch))
            {
                _query = _query.Where(u => u.FirstName.Contains(request.sSearch) || u.Email.Contains(request.sSearch) || u.PostalCode.Contains(request.sSearch) || u.Phone.Contains(request.sSearch) || u.Position.Contains(request.sSearch) || u.Organization.Contains(request.sSearch) || u.LastUpdatedOn.ToString().Contains(request.sSearch));
            }

            switch (request.iSortCol_0)
            {
            case 0:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(u => u.FirstName) : _query.OrderByDescending(u => u.FirstName);
                break;

            case 1:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(u => u.Email) : _query.OrderByDescending(u => u.Email);
                break;

            case 2:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(u => u.Phone) : _query.OrderByDescending(u => u.Phone);
                break;

            case 3:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(u => u.PostalCode) : _query.OrderByDescending(u => u.PostalCode);
                break;

            case 4:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(u => u.Position) : _query.OrderByDescending(u => u.Position);
                break;

            case 5:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(u => u.Organization) : _query.OrderByDescending(u => u.Organization);
                break;

            case 6:
                _query = request.sSortDir_0 == "asc" ? _query.OrderBy(u => u.LastUpdatedOn) : _query.OrderByDescending(u => u.LastUpdatedOn);
                break;

            default:
                _query = _query.OrderByDescending(u => u.ID);
                break;
            }

            int _count = await _query.CountAsync();

            var _data = await _query.Skip(request.iDisplayStart).Take(request.iDisplayLength).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row = new DataTableRow();

                _row.Add(_rowData.Title + ". " + _rowData.FirstName + " " + _rowData.LastName);
                _row.Add(@"<a href='/L0C5A3E8915871B710C2CC98073748424/users/details/" + _rowData.ID + "'>" + _rowData.Email + "</a>");


                if (!string.IsNullOrEmpty(_rowData.Phone))
                {
                    _row.Add(_rowData.Phone);
                }
                else
                {
                    _row.Add("-");
                }

                if (!string.IsNullOrEmpty(_rowData.PostalCode))
                {
                    _row.Add(_rowData.PostalCode);
                }
                else
                {
                    _row.Add("-");
                }

                if (!string.IsNullOrEmpty(_rowData.Position))
                {
                    _row.Add(_rowData.Position);
                }
                else
                {
                    _row.Add("-");
                }

                if (!string.IsNullOrEmpty(_rowData.Organization))
                {
                    _row.Add(_rowData.Organization);
                }
                else
                {
                    _row.Add("-");
                }

                _row.Add(_rowData.LastUpdatedOn.ToString());

                _rows.Add(_row);
            }

            return(Json(new DataTableResponse
            {
                sEcho = request.sEcho,
                iDisplayLength = request.iDisplayLength,
                iTotalRecords = _count,
                iDisplayStart = request.iDisplayStart,
                iTotalDisplayRecords = _count,
                aaData = _rows
            }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 9
0
        private async Task <string> GenerateExcelFile()
        {
            DateTime Now = AppManager.Now.Date;

            var _query = from u in db.Users
                         where u.IsDataActive
                         select new
            {
                u.ID,
                u.FirstName,
                u.LastName,
                u.Title,
                u.Position,
                u.Organization,
                u.Email,
                u.Phone,
                u.PostalCode,
                u.LastUpdatedOn,
            };

            var _data = await _query.OrderByDescending(o => o.ID).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row = new DataTableRow();

                string _statusHtml = string.Empty;

                _row.Add(_rowData.FirstName + " " + _rowData.LastName);
                _row.Add(_rowData.Email);
                _row.Add(_rowData.Phone);
                _row.Add(_rowData.PostalCode);
                _row.Add(_rowData.Position);
                _row.Add(_rowData.Organization);
                _row.Add(_rowData.LastUpdatedOn.ToString());

                _rows.Add(_row);
            }

            var _workbook  = new XLWorkbook();
            var _worksheet = _workbook.Worksheets.Add("Users");

            _worksheet.Cell("A1").Value = "Name";
            _worksheet.Cell("B1").Value = "Email";
            _worksheet.Cell("C1").Value = "Phone";
            _worksheet.Cell("D1").Value = "Postal Code";
            _worksheet.Cell("E1").Value = "Position";
            _worksheet.Cell("F1").Value = "Organization";
            _worksheet.Cell("G1").Value = "Last Updated On";

            int _rowIndex = 2;

            foreach (DataTableRow _row in _rows)
            {
                _worksheet.Cell("A" + _rowIndex).Value = _row.ElementAt(0);
                _worksheet.Cell("B" + _rowIndex).Value = _row.ElementAt(1);
                _worksheet.Cell("C" + _rowIndex).Value = "'" + _row.ElementAt(2);
                _worksheet.Cell("D" + _rowIndex).Value = "'" + _row.ElementAt(3);
                _worksheet.Cell("E" + _rowIndex).Value = "'" + _row.ElementAt(4);
                _worksheet.Cell("F" + _rowIndex).Value = _row.ElementAt(5);
                _worksheet.Cell("G" + _rowIndex).Value = _row.ElementAt(6);
                _rowIndex++;
            }

            _worksheet.Row(1).Style.Font.Bold = true;
            _workbook.SaveAs(HostingEnvironment.MapPath("/Exports/users.xlsx"));

            return("/Exports/users.xlsx");
        }
Ejemplo n.º 10
0
        private async Task <string> GenerateExcelFile(string type)
        {
            if (type == "seratio")
            {
                type = "Seratio Coin";
            }
            else if (type == "womenscoin")
            {
                type = "Womens Coin";
            }
            else if (type == "studentcoin")
            {
                type = "Student Coin";
            }
            else if (type == "10xgrowth")
            {
                type = "Growth Token";
            }
            else if (type == "ttc")
            {
                type = "TimeTraveler Coin";
            }


            var _query = from i in db.Investments
                         join u in db.Users on i.UserID equals u.ID
                         where i.Type == type
                         select new
            {
                i.ID,
                i.Mode,
                i.Amount,
                i.Status,
                i.InitializedOn,
                i.LastUpdatedOn,
                i.TxRefNoUpdatedOn,
                i.TxReferenceNumber,
                i.UserID,
                u.Title,
                u.FirstName,
                i.ReceivedAmount,
                u.LastName,
                i.Token,
                u.Email,
                i.ExchangeRate,
                i.ConfirmedOn,
                i.RejectedOn,
                i.OriginalExchangeRate,
                i.UserSessionID,
                i.UserSession,
                i.CampaignCode,
                i.InvestmentType,
                i.TokenAmount,
                i.Type,
                u.Phone,
                u.ReferralSource,
                i.HasTransferred,
                u.PostalCode
            };


            var _data = await _query.OrderByDescending(o => o.ID).ToListAsync();

            List <DataTableRow> _rows = new List <DataTableRow>();

            foreach (var _rowData in _data)
            {
                DataTableRow _row = new DataTableRow();

                _row.Add(_rowData.Title);
                _row.Add($"{_rowData.FirstName} {_rowData.LastName}");
                _row.Add(_rowData.Email);
                _row.Add(_rowData.Phone);
                _row.Add(_rowData.Mode);
                _row.Add(_rowData.Type);
                _row.Add(_rowData.Amount);
                _row.Add(_rowData.Token);

                if (_rowData.UserSessionID != null)
                {
                    _row.Add(_rowData.UserSession.IPAddress);
                }
                else
                {
                    _row.Add("N/A");
                }

                _row.Add(_rowData.CampaignCode);

                if (_rowData.InvestmentType != null)
                {
                    _row.Add(_rowData.InvestmentType);
                }
                else
                {
                    _row.Add("N/A");
                }

                _row.Add(_rowData.InitializedOn.ToString());

                if (_rowData.OriginalExchangeRate != null)
                {
                    _row.Add(String.Format("'{0:0.0000000}", _rowData.OriginalExchangeRate.ToString()));
                }
                else
                {
                    _row.Add("N/A");
                }

                if (_rowData.TxReferenceNumber != null)
                {
                    _row.Add(_rowData.TxReferenceNumber);
                }
                else
                {
                    _row.Add("Pending");
                }

                if (_rowData.ConfirmedOn != null)
                {
                    _row.Add(_rowData.ConfirmedOn);
                }
                else
                {
                    _row.Add("Pending");
                }
                if (_rowData.ConfirmedOn != null)
                {
                    _row.Add(_rowData.ReceivedAmount.ToString());
                }
                else
                {
                    _row.Add("Pending");
                }

                if (_rowData.ExchangeRate != null)
                {
                    _row.Add(String.Format("{0:0.00}", _rowData.ExchangeRate.ToString()));
                }
                else
                {
                    _row.Add("N/A");
                }

                string _statusHtml = "";

                if (_rowData.ConfirmedOn != null)
                {
                    _statusHtml = "Confirmed";
                }
                else
                {
                    if (_rowData.RejectedOn != null)
                    {
                        _statusHtml = "Rejected";
                    }
                    else
                    {
                        _statusHtml = "Pending";
                    }
                }

                if (_rowData.Type == "Growth Token" && _rowData.Status == "Confirmed" && _rowData.HasTransferred == true)
                {
                    _statusHtml = $"YOUR {_rowData.ReceivedAmount} SER TOKENS HAVE NOW BEEN TRANSFERRED TO THE GROWTH TOKEN CRYPTOFUND";
                }
                else if (_rowData.Type == "Growth Token" && _rowData.Status == "Confirmed")
                {
                    _statusHtml = "INVESTMENT CONFIRMED, PENDING TRANSFER TO THE GROWTH TOKEN CRYPTOFUND";
                }

                _row.Add(_statusHtml);

                if (!string.IsNullOrEmpty(_rowData.TokenAmount))
                {
                    _row.Add(_rowData.TokenAmount);
                }
                else
                {
                    _row.Add("N/A");
                }

                _row.Add(_rowData.ReferralSource);
                _row.Add(_rowData.PostalCode);

                _rows.Add(_row);
            }

            var _workbook  = new XLWorkbook();
            var _worksheet = _workbook.Worksheets.Add("Investments");

            _worksheet.Cell("A1").Value = "Contributor (Title)";
            _worksheet.Cell("B1").Value = "Contributor (Name)";
            _worksheet.Cell("C1").Value = "Contributor (Email)";
            _worksheet.Cell("D1").Value = "Contributor (Phone)";

            _worksheet.Cell("E1").Value = "Contribution Type";
            _worksheet.Cell("F1").Value = "ICO Type";
            _worksheet.Cell("G1").Value = "Amount";
            _worksheet.Cell("H1").Value = "Token ID ";
            _worksheet.Cell("I1").Value = "IP Address";
            _worksheet.Cell("J1").Value = "Campaign code";
            _worksheet.Cell("K1").Value = "Token Type";
            _worksheet.Cell("L1").Value = "Contribution Requested On";
            _worksheet.Cell("M1").Value = "Original Exchange rate";
            _worksheet.Cell("N1").Value = "Transaction ID";
            _worksheet.Cell("O1").Value = "Contribution Received On";
            _worksheet.Cell("P1").Value = "Contribution Received Amount";
            _worksheet.Cell("Q1").Value = "Exchange Rate";
            _worksheet.Cell("R1").Value = "Confirmed";
            _worksheet.Cell("S1").Value = "Token Amount";
            _worksheet.Cell("T1").Value = "Referral Source";
            _worksheet.Cell("U1").Value = "Postal Address";

            int _rowIndex = 2;

            foreach (DataTableRow _row in _rows)
            {
                _worksheet.Cell("A" + _rowIndex).Value = _row.ElementAt(0);
                _worksheet.Cell("B" + _rowIndex).Value = _row.ElementAt(1);
                _worksheet.Cell("C" + _rowIndex).Value = _row.ElementAt(2);
                _worksheet.Cell("D" + _rowIndex).Value = "'" + _row.ElementAt(3);
                _worksheet.Cell("E" + _rowIndex).Value = "'" + _row.ElementAt(4);
                _worksheet.Cell("F" + _rowIndex).Value = _row.ElementAt(5);
                _worksheet.Cell("G" + _rowIndex).Value = _row.ElementAt(6);
                _worksheet.Cell("H" + _rowIndex).Value = _row.ElementAt(7);
                _worksheet.Cell("I" + _rowIndex).Value = _row.ElementAt(8);
                _worksheet.Cell("J" + _rowIndex).Value = _row.ElementAt(9);
                _worksheet.Cell("K" + _rowIndex).Value = _row.ElementAt(10);
                _worksheet.Cell("L" + _rowIndex).Value = _row.ElementAt(11);
                _worksheet.Cell("M" + _rowIndex).Value = _row.ElementAt(12);
                _worksheet.Cell("N" + _rowIndex).Value = "'" + _row.ElementAt(13);
                _worksheet.Cell("O" + _rowIndex).Value = "'" + _row.ElementAt(14);
                _worksheet.Cell("P" + _rowIndex).Value = _row.ElementAt(15);
                _worksheet.Cell("Q" + _rowIndex).Value = _row.ElementAt(16);
                _worksheet.Cell("R" + _rowIndex).Value = _row.ElementAt(17);
                _worksheet.Cell("S" + _rowIndex).Value = _row.ElementAt(18);
                _worksheet.Cell("T" + _rowIndex).Value = _row.ElementAt(19);
                _worksheet.Cell("U" + _rowIndex).Value = _row.ElementAt(20);

                _rowIndex++;
            }

            _worksheet.Row(1).Style.Font.Bold = true;
            _workbook.SaveAs(HostingEnvironment.MapPath($"/Exports/Investments_{type}.xlsx"));

            return($"/Exports/Investments_{type}.xlsx");
        }