Esempio n. 1
0
        public Response <IEnumerable <Driver> > AddOrUpdateDriver(AddOrUpdateDriverRequest request)
        {
            Response <IEnumerable <Driver> > response = new Response <IEnumerable <Driver> >();

            if (request == null || request.DriverCollection == null || !request.DriverCollection.Any())
            {
                ArgumentNullException ex = new ArgumentNullException("AddOrUpdateDriver request");
                LogError(ex);
                response.ErrorCode = ErrorCode.Argument;
                response.Exception = ex;
                return(response);
            }

            try
            {
                DriverManagementAccessor accessor = new DriverManagementAccessor();
                response.Result    = accessor.AddOrUpdateCRMDriver(request.DriverCollection);
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
                LogError(ex);
                response.Exception = ex;
                response.IsSuccess = false;
                response.ErrorCode = ErrorCode.Technical;
            }

            return(response);
        }
Esempio n. 2
0
        public CRMDriver addCreateDriver(GetCRMDriverByConditionRequest request)
        {
            CRMDriver CreateDriver = new CRMDriver();

            try
            {
                CRMDriver         Driver    = new CRMDriver();
                IList <CRMDriver> CRMDriver = new List <CRMDriver>();
                CRMDriver.Add(request.AddDriver);
                DriverManagementAccessor accessor = new DriverManagementAccessor();
                CreateDriver = accessor.AddOrUpdateCRMDriver(CRMDriver);// request.PageIndex, request.PageSize, out RowCount
            }
            catch (Exception)
            {
                throw;
            }
            return(CreateDriver);
        }