public async Task <IActionResult> ContentRejectedList(int pageNo, int pageSize)
        {
            try
            {
                ReportDataAccess _reportAccess = new ReportDataAccess(_iconfiguration);
                var parameters     = HttpUtility.ParseQueryString(Request.QueryString.Value);
                var paramIsSearch  = parameters["search"];
                var paramSortType  = parameters["sortType"];
                var paramSortfield = string.IsNullOrEmpty(parameters["sortField"]) ? 0 : int.Parse(parameters["sortField"]);


                DatabaseResponse response = await _reportAccess.ContentRejectedList(pageNo, pageSize, paramIsSearch, paramSortType, paramSortfield);

                if (response.ResponseCode == (int)DbReturnValue.RecordExists)
                {
                    return(Ok(new OperationResponse
                    {
                        HasSucceeded = true,
                        IsDomainValidationErrors = false,
                        Message = EnumExtensions.GetDescription(DbReturnValue.RecordExists),
                        ReturnedObject = response.Results
                    }));
                }
                else
                {
                    Log.Error(EnumExtensions.GetDescription(DbReturnValue.NoRecords));

                    return(Ok(new OperationResponse
                    {
                        HasSucceeded = false,
                        IsDomainValidationErrors = false,
                        Message = EnumExtensions.GetDescription(DbReturnValue.NoRecords)
                    }));
                }
            }
            catch (Exception ex)
            {
                Log.Error(new ExceptionHelper().GetLogString(ex, ErrorLevel.Critical));

                return(Ok(new OperationResponse
                {
                    HasSucceeded = false,
                    Message = StatusMessages.ServerError,
                    StatusCode = ((int)ResponseStatus.ServerError).ToString(),
                    IsDomainValidationErrors = false
                }));
            }
        }
        public async Task <IActionResult> AddVisiter(int?userId)
        {
            try
            {
                ReportDataAccess _reportAccess = new ReportDataAccess(_iconfiguration);

                DatabaseResponse response = await _reportAccess.AddVisiter(userId);

                if (response.ResponseCode == (int)DbReturnValue.CreateSuccess)
                {
                    return(Ok(new OperationResponse
                    {
                        HasSucceeded = true,
                        IsDomainValidationErrors = false,
                        Message = EnumExtensions.GetDescription(DbReturnValue.CreateSuccess),
                        ReturnedObject = response.Results
                    }));
                }
                else
                {
                    Log.Error(EnumExtensions.GetDescription(DbReturnValue.CreationFailed));

                    return(Ok(new OperationResponse
                    {
                        HasSucceeded = false,
                        IsDomainValidationErrors = false,
                        Message = EnumExtensions.GetDescription(DbReturnValue.RecordExists),
                        ReturnedObject = response.Results
                    }));
                }
            }
            catch (Exception ex)
            {
                Log.Error(new ExceptionHelper().GetLogString(ex, ErrorLevel.Critical));

                return(Ok(new OperationResponse
                {
                    HasSucceeded = false,
                    Message = StatusMessages.ServerError,
                    StatusCode = ((int)ResponseStatus.ServerError).ToString(),
                    IsDomainValidationErrors = false
                }));
            }
        }
 /// <summary>
 /// Gets the report data for average cost by engineer report
 /// </summary>
 /// <returns>a list of reportrow to construct a report</returns>
 public IEnumerable <ReportRow> printAverageCostByEngineer()
 {
     return(ReportDataAccess.averageCostByEngineer().Select(c => new ReportRow(c)).ToList());
 }
 /// <summary>
 /// Gets the report data for total cost by district report
 /// </summary>
 /// <returns>a list of reportrow to construct a report</returns>
 public IEnumerable <ReportRow> printTotalCostByDistrict()
 {
     return(ReportDataAccess.costByDistrict().Select(c => new ReportRow(c)).ToList());
 }
 /// <summary>
 /// Gets the report data for monthly cost by district report
 /// </summary>
 /// <returns>a list of reportrow to construct a report</returns>
 public IEnumerable <ReportRow> printMonthlyCostByDistrict(Guid districtId)
 {
     return(ReportDataAccess.monthlyCostForDistrict(districtId).Select(c => new ReportRow(c)).ToList());
 }
Exemple #6
0
 /// <summary>
 /// Gets the report data for total cost by engineer report
 /// </summary>
 /// <returns>a list of reportrow to construct a report</returns>
 public IEnumerable <ReportRow> printTotalCostByEngineer()
 {
     return(ReportDataAccess.totalCostByEngineer((int)UserType.SiteEngineer, (int)InterventionState.Completed).Select(c => new ReportRow(c)).ToList());
 }
Exemple #7
0
 /// <summary>
 /// Gets the report data for total cost by district report
 /// </summary>
 /// <returns>a list of reportrow to construct a report</returns>
 public IEnumerable <ReportRow> printTotalCostByDistrict()
 {
     return(ReportDataAccess.costByDistrict((int)InterventionState.Completed).Select(c => new ReportRow(c)).ToList());
 }
Exemple #8
0
 /// <summary>
 /// Gets the report data for monthly cost by district report
 /// </summary>
 /// <returns>a list of reportrow to construct a report</returns>
 public IEnumerable <ReportRow> printMonthlyCostByDistrict(Guid districtId)
 {
     return(ReportDataAccess.monthlyCostForDistrict(districtId, (int)InterventionState.Completed).Select(c => new ReportRow(c)).ToList());
 }
 public DataTable GetreportDetailsusingmembernamewithdate()
 {
     return(ReportDataAccess.GetreportDetailsusingmembernamewithdate(FDate, Todate, Membername));
 }
 public SqlDataReader GetAmountusingDatenmember()
 {
     return(ReportDataAccess.GetAmountusingDatenmember(FDate, Todate, Membername));
 }
 public SqlDataReader GetAmountusingDate()
 {
     return(ReportDataAccess.GetAmountusingDate(FDate, Todate));
 }
 public DataTable GetreportDetailsusingmembername()
 {
     return(ReportDataAccess.GetreportDetailsusingmembername(Membername));
 }
 public DataTable GetDonationDetailsusingDate()
 {
     return(ReportDataAccess.GetDonationDetailsusingDate(FDate, Todate));
 }