public HttpResponseMessage GetVendorTypeList()
        {
            var repository = new VendorTypeRepository();
            var result     = repository.ListAllVendorTypes();

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }
        public HttpResponseMessage GetSingleVendorType(int id)
        {
            var repository = new VendorTypeRepository();
            var result     = repository.GetVendorTypeById(id);

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }
Beispiel #3
0
 /// <summary>
 /// Created By Ashutosh Dwivedi
 /// for Deleting the Vendor Type and set IsDeleted Field to 1
 /// </summary>
 /// <param name="vendorId"></param>
 /// <param name="loggedInUserId"></param>
 /// <returns></returns>
 public Result DeleteVendorType(long vendorId, long loggedInUserId, string location)
 {
     try
     {
         Result result;
         if (vendorId > 0)
         {
             VendorTypeRepository objVendorTypeRepository = new VendorTypeRepository();
             var data = objVendorTypeRepository.GetSingleOrDefault(v => v.VDT_Id == vendorId && v.VDT_IsActive == "Y");
             if (data != null)
             {
                 data.VDT_IsActive = "X";
                 objVendorTypeRepository.Update(data);
                 objVendorTypeRepository.SaveChanges();
                 return(Result.Delete);
             }
         }
         else
         {
             return(Result.DoesNotExist);
         }
         return(Result.Delete);
     }
     catch (Exception ex)
     {
         Exception_B.Exception_B.exceptionHandel_Runtime(ex, " public Result DeleteVendorType(long vendorId, long loggedInUserId)", "Exception While Deleting Vendor.", null);
         throw;
     }
 }