public async Task <IActionResult> DeleteComplaint(string complaintId)
        {
            var response = await _complaintsServices.DeleteComplaint(complaintId);

            if (response.Success)
            {
                return(Ok(response));
            }
            return(BadRequest(response));
        }
Пример #2
0
 public IActionResult Delete(int id)
 {
     try
     {
         _complaintService.DeleteComplaint(id);
         return(Ok("Delete complaint request sent successfully!"));
     }
     catch (Exception ex)
     {
         return(BadRequest("Request not done. Please contact Admin. Error Message: " + ex.Message));
     }
 }
        private async Task ComplainRegisterClickCommand()
        {
            _complaintService.DeleteComplaint();
            ComplaintModelObj = await _complaintService.GetNonComplaintModel() ?? new ComplaintModel();

            ComplaintModelObj.ShopAddress         = "";
            ComplaintModelObj.ShopName            = "";
            ComplaintModelObj.Files               = "";
            ComplaintModelObj.ExternalId          = 0;
            ComplaintModelObj.Operation           = (int)Operations.Non;
            ComplaintModelObj.LowsId              = "";
            ComplaintModelObj.ApplicationType     = 1;
            ComplaintModelObj.IsEmptyModel        = false;
            ComplaintModelObj.SpeciesName         = "";
            ComplaintModelObj.SpeciesId           = 0;
            ComplaintModelObj.Violations          = "";
            ComplaintModelObj.Cityid              = _settings.UserCityId;
            ComplaintModelObj.IsActive            = true;
            ComplaintModelObj.IsDelete            = false;
            ComplaintModelObj.Comments            = "";
            ComplaintModelObj.DateOfInspection    = DateTime.Now;
            ComplaintModelObj.LowsId              = "";
            ComplaintModelObj.CreatedBy           = _settings.UserId;
            ComplaintModelObj.ModifiedBy          = _settings.UserId;
            ComplaintModelObj.CreatedDate         = DateTime.Now;
            ComplaintModelObj.ModifiedDate        = DateTime.Now;
            ComplaintModelObj.Files               = "";
            ComplaintModelObj.IsEmailSend         = false;
            ComplaintModelObj.ComplainStatus      = 1;
            ComplaintModelObj.IsRejecet           = false;
            ComplaintModelObj.CommentForRejection = "";
            ComplaintModelObj.IsRegister          = false;
            ComplaintModelObj.CreatedUserName     = _settings.Name;
            ComplaintModelObj.UserMobileNumber    = _settings.PhoneNumber;
            ComplaintModelObj.CityName            = _settings.UserCity;
            ComplaintModelObj.IsUpdate            = true;

            await _complaintService.SaveComplaint(ComplaintModelObj);

            await NavigationService.NavigateAsync(AppPages.ComplaintRegister.ComplaintRegisterPage);
        }
Пример #4
0
        private async Task CompalinStatusMethod(ComplaintsDTO complaints)
        {
            try
            {
                IsBusy = true;

                _complaintService.DeleteComplaint();
                if (_settings.IsOnline)
                {
                    IsBusy = true;

                    ComplaintModelObj = await _complaintService.GetNonComplaintModel() ?? new ComplaintModel();

                    if (ComplaintModelObj != null)
                    {
                        ComplaintModelObj.ShopAddress = complaints.ShopAddress ?? "";
                        ComplaintModelObj.ShopName    = complaints.ShopName ?? "";

                        ComplaintModelObj.Files = complaints.ComplaintFiles ?? "";
                        if (!string.IsNullOrEmpty(ComplaintModelObj.Files))
                        {
                            List <string> SplitFilePaths = new List <string>();
                            List <string> AddFilePaths   = new List <string>();
                            SplitFilePaths = ComplaintModelObj.Files.Split(',')?.ToList();
                            if (SplitFilePaths.AnyExtended())
                            {
                                foreach (var item in SplitFilePaths)
                                {
                                    var localFilePath = await FileExtensions.DownloadImageFromUrlSaveLocal(item);

                                    AddFilePaths.Add(localFilePath);
                                }
                            }
                            ComplaintModelObj.Files          = string.Join(",", AddFilePaths.ToArray());
                            ComplaintModelObj.ComplaintFiles = ComplaintModelObj.Files;
                        }
                        else
                        {
                            ComplaintModelObj.Files = "";
                        }

                        ComplaintModelObj.ExternalId          = complaints.Id;
                        ComplaintModelObj.Operation           = (int)Operations.Non;
                        ComplaintModelObj.LowsId              = complaints.ComplaintLowsId;
                        ComplaintModelObj.ComplaintLowsId     = complaints.ComplaintLowsId;
                        ComplaintModelObj.ApplicationType     = 1;
                        ComplaintModelObj.IsEmptyModel        = false;
                        ComplaintModelObj.SpeciesName         = complaints.SpeciesName;
                        ComplaintModelObj.SpeciesId           = complaints.SpeciesId;
                        ComplaintModelObj.Violations          = complaints.Violations;
                        ComplaintModelObj.Cityid              = _settings.UserCityId;
                        ComplaintModelObj.ComplainStatus      = complaints.ComplainStatus;
                        ComplaintModelObj.IsActive            = true;
                        ComplaintModelObj.GpsLocations        = complaints.GpsLocations;
                        ComplaintModelObj.IsDelete            = false;
                        ComplaintModelObj.Comments            = complaints.Comments;
                        ComplaintModelObj.DateOfInspection    = complaints.DateOfInspection;
                        ComplaintModelObj.IsRejecet           = complaints.IsRejecet ?? false;
                        ComplaintModelObj.CommentForRejection = complaints.CommentForRejection;
                        ComplaintModelObj.RegistrationDate    = complaints.RegistrationDate ?? DateTime.UtcNow;
                        ComplaintModelObj.IsRegister          = complaints.IsRegister;
                        ComplaintModelObj.IsEmailSend         = complaints.IsEmailSend;
                        ComplaintModelObj.CreatedBy           = complaints.CreatedBy;
                        ComplaintModelObj.ModifiedBy          = complaints.ModifiedBy;
                        ComplaintModelObj.CreatedDate         = complaints.CreatedDate ?? DateTime.UtcNow;
                        ComplaintModelObj.ModifiedDate        = complaints.ModifiedDate ?? DateTime.UtcNow;
                        ComplaintModelObj.CreatedUserName     = complaints.CreatedUserName;
                        ComplaintModelObj.UserMobileNumber    = complaints.UserMobileNumber;
                        ComplaintModelObj.ModifiedDate        = complaints.ModifiedDate ?? DateTime.UtcNow;
                        ComplaintModelObj.CityName            = complaints.CityName;
                        ComplaintModelObj.IsUpdate            = false;
                        await _complaintService.SaveComplaint(ComplaintModelObj);


                        IsBusy = false;
                        NavigationParameters navigationparameters = new NavigationParameters();
                        navigationparameters.Add("complaintdto", complaints);
                        await NavigationService.NavigateAsync(new System.Uri($"/{AppPages.SSCMaster.SSCMasterPage}/{AppPages.NavigationPage}/{AppPages.DashBoard.HomePage}/{AppPages.DashBoard.ComplaintStatusPage}/{AppPages.ComplaintRegister.ComplaintOverviewPage}", System.UriKind.RelativeOrAbsolute), navigationparameters);
                    }
                    IsBusy = false;
                }
                else
                {
                    _userDialogs.Toast("There is no INTERNET connection", new TimeSpan(20));
                }
                IsBusy = false;
            }
            catch (Exception ex)
            {
                IsBusy = false;
                await PageDialogService.DisplayAlertAsync(null, AppAlertMessage.TechnicalError, "OK");
            }
        }