Пример #1
0
 public string RejectRent(int id)
 {
     try
     {
         RentInfoBusiness repo   = new RentInfoBusiness();
         bool             result = repo.Reject(id);
         return(result == true ? "Rejected succesfuly!" : "Rejecting Failed!");
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File,
                       "Confirm Reent failed. " + id + "\n" + ExceptionHelper.ExceptionToString(ex));
         return("Rejecting failed! Exception : " + ex.Message);
     }
 }
Пример #2
0
        public HttpResponseMessage RentInfoForCustomer(int id)
        {
            try
            {
                RentInfoBusiness repo = new RentInfoBusiness();
                var result            = repo.InfoForCustomer(id);

                RezInfo info = new RezInfo()
                {
                    IsRequestPending = Convert.ToBoolean(result.IsRequestPending),
                    IsRented         = Convert.ToBoolean(result.IsRented)
                };
                return(Request.CreateResponse(HttpStatusCode.OK, info));
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File,
                              "Rent Info For Customer failed. " + id + "\n" + ExceptionHelper.ExceptionToString(ex));
                return(null);
            }
        }
Пример #3
0
        public HttpResponseMessage RentExtraInfo(int id)
        {
            try
            {
                RentInfoBusiness repo = new RentInfoBusiness();
                var result            = repo.Find(id);

                RentInfoModel model = new RentInfoModel()
                {
                    Customer = new Customers()
                    {
                        Address = result.Customers.Address,
                        BeginningDateOfDriverLicense = result.Customers.BeginningDateOfDriverLicense,
                        EndingDateOfDriverLicense    = result.Customers.EndingDateOfDriverLicense,
                        CityOfBirth          = result.Customers.CityOfBirth,
                        IdentificationNumber = result.Customers.IdentificationNumber,
                        Name    = result.Customers.Name,
                        Surname = result.Customers.Surname
                    },
                    Vehicle = new Vehicles()
                    {
                        Brand     = result.Vehicles.Brand,
                        ModelName = result.Vehicles.ModelName,
                        Plate     = result.Vehicles.Plate
                    }
                };


                return(Request.CreateResponse(HttpStatusCode.OK, model));
            }
            catch (Exception ex)
            {
                LogHelper.Log(LogTarget.File,
                              "Confirm Reent failed. " + id + "\n" + ExceptionHelper.ExceptionToString(ex));
                return(null);
            }
        }