Example #1
0
        public void CreateDeptBusiUnit()
        {
            var deptId = Guid.NewGuid();
            var busiId = Guid.NewGuid();
            var unitId = Guid.NewGuid();

            var unit = new LocationUnit()
            {
                UnitId = unitId, UnitName = "TEST Unit 2", BusinessLocationId = busiId
            };
            var business = new LocationBusiness()
            {
                BusinessLocationId = busiId, BusinessName = "Test Business 2", DepartmentId = deptId, Unit = new List <LocationUnit>()
                {
                    unit
                }
            };
            var department = new LocationDepartment()
            {
                DepartmentId = deptId, DepatmentName = "Test Department 2", Business = new List <LocationBusiness>()
                {
                    business
                }
            };

            dFactory.Create(department);
        }
Example #2
0
        public void CreateBusiness()
        {
            var business = new LocationBusiness()
            {
                BusinessLocationId = Guid.NewGuid(), BusinessName = "Test Business", DepartmentId = Guid.Parse("1b367716-568a-6f43-a695-022699cee763")
            };

            bFactory.Create(business);
        }
 public void UpdateLocationBusiness()
 {
     try
     {
         ILocationBusiness locationbusiness = new LocationBusiness();
         locationbusiness.BusinessLocationId = Guid.Parse("237E51C1-E759-4C5F-82E2-7233F833D241");
         locationbusiness.BusinessName       = "Cat Cracker";
         locationbusiness.DepartmentId       = Guid.Parse("6EFD9490-7CFA-4EB1-8C5A-28B0A98936F8");
         ltr.Update((LocationBusiness)locationbusiness);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public void AddLocationBusiness()
 {
     try
     {
         ILocationBusiness locationbusiness = new LocationBusiness();
         locationbusiness.BusinessLocationId = Guid.NewGuid();
         locationbusiness.BusinessName       = "Cat Cracker2";
         locationbusiness.DepartmentId       = Guid.Parse("9EBA6D35-66D7-4905-8D2D-34F772D03733");
         ltr.Create((LocationBusiness)locationbusiness);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 // PUT: api/LocationBusiness/5
 public HttpResponseMessage Put(LocationBusiness locationBusiness)
 {
     try
     {
         response.StatusCode           = HttpStatusCode.Created;
         response.Content              = new StringContent(locationBusinessFactory.Update(locationBusiness).ToString());
         response.Headers.CacheControl = new CacheControlHeaderValue()
         {
             MaxAge = TimeSpan.FromMinutes(20)
         };
     }
     catch (Exception ex)
     {
         response.StatusCode           = HttpStatusCode.BadRequest;
         response.Content              = new StringContent(ex.Message);
         response.Headers.CacheControl = new CacheControlHeaderValue()
         {
             MaxAge = TimeSpan.FromMinutes(20)
         };
     }
     return(response);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="configuration">configuration object</param>
 /// <param name="logger">loggin object</param>
 public LocationController(IOptions <ConfigurationModel> configuration, ILogger <LocationController> logger)
 {
     _configurations   = configuration;
     _locationBusiness = new LocationBusiness(_configurations.Value);
     _logger           = logger;
 }
Example #7
0
 public LocationController(IOptions <ConfigurationModel> configuration)
 {
     _configurations   = configuration;
     _locationBusiness = new LocationBusiness(_configurations.Value);
 }