Beispiel #1
0
 public async Task <JsonResult> UpdateStallRegistration([FromBody] StallRegistrationDto stallregisterDto)
 {
     try
     {
         if (stallregisterDto.IsApproved == true && stallregisterDto.IsRejected != true)
         {
             RepositoryWrapper.StallDetails.UpdateStallAssigned(stallregisterDto.StallId);
             RepositoryWrapper.StallRegistration.UpdateStallRegistrationAdmin(stallregisterDto.Id, stallregisterDto.ApproveBy, stallregisterDto.IsApproved, stallregisterDto.IsRejected, stallregisterDto.RejectReason);
             return(await base.FinalizeMessage("StallRegistration Sucessfully Approved"));
         }
         else if (stallregisterDto.IsRejected == true && stallregisterDto.IsApproved != true && stallregisterDto.RejectReason != null && stallregisterDto.RejectReason != "")
         {
             RepositoryWrapper.StallRegistration.UpdateStallRegistrationAdmin(stallregisterDto.Id, stallregisterDto.ApproveBy, stallregisterDto.IsApproved, stallregisterDto.IsRejected, stallregisterDto.RejectReason);
             return(await base.FinalizStatusCodeeMessage("StallRegistration Rejected", 200));
         }
         else
         {
             return(await base.FinalizStatusCodeeMessage("Error: Approved and Rejected Both Should not be true at same time  Or If Rejected Enter Reject Reason Compulsory", 500));
         }
     }
     catch (Exception ex)
     {
         return(await base.FinalizStatusCodeeMessage("Error: Failure in Stall Update : " + ex, 401));
     }
 }
Beispiel #2
0
        public async Task <JsonResult> StallRegistration([FromBody] StallRegistrationDto stallregisterDto)
        {
            try
            {
                RepositoryWrapper.StallRegistration.StallRegistration(stallregisterDto.UserId, stallregisterDto.StallId);


                if (stallregisterDto.Category.ToList().Count == 0)
                {
                    return(await base.FinalizStatusCodeeMessage("Error: Category Is Not Selected Or Empty", 500));
                }

                RepositoryWrapper.StallProductCategories.StallProductCategories(stallregisterDto.Category.ToList(), stallregisterDto.StallId);

                return(await base.FinalizStatusCodeeMessage("Stall Registered Sucessfully", 200));
            }
            catch (Exception ex)
            {
                return(await base.FinalizStatusCodeeMessage("Error: Failure in Stall Registration : " + ex, 500));
            }
        }