示例#1
0
        public ProjectQuotesViewTest()
        {
            driver = new ChromeDriver(@"C:\Q2O\Source\Iterations\Iteration 8\Daikin Project Office\DaikinProjectOffice.Tests\libraries");

            projectService      = new ProjectServices();
            accountService      = new AccountServices();
            orderService        = new OrderServices();
            projectVM           = new ProjectModel();
            projectServiceLight = new ProjectServiceLight();
            orderServiceLight   = new OrderServiceLight();
            addressService      = new AddressServices();

            user = accountService.GetUserSessionModel("*****@*****.**").Model as UserSessionModel;

            projectId = this.db.Projects
                        .Where(p => p.ProjectStatusTypeId == ProjectStatusTypeEnum.Open &&
                               p.OwnerId == user.UserId).OrderByDescending(p => p.ProjectTypeId)
                        .Select(p => p.ProjectId).FirstOrDefault();

            project = this.db.Context.Projects
                      .Where(p => p.OwnerId == user.UserId &&
                             p.ProjectStatusTypeId == ProjectStatusTypeEnum.Open
                             ).OrderByDescending(p => p.ProjectTypeId)
                      .FirstOrDefault();

            quoteId = this.db.Context.Quotes.Where(q => q.ProjectId == projectId).OrderByDescending(q => q.QuoteId).Select(q => q.QuoteId).FirstOrDefault();

            projectVM = projectService.GetProjectModel(user, projectId).Model as ProjectModel;
        }
示例#2
0
        public async Task DeleteUnexistingAddressShouldReturnFalse()
        {
            var context   = InMemoryDatabase.GetDbContext();
            var invalidId = 55;

            var addressServices = new AddressServices(context);
            var actualResult    = await addressServices.DeleteAddressAsync(invalidId);

            Assert.IsFalse(actualResult, ShouldReturnFalseMessage);
        }
示例#3
0
        public void LoadCity(EventArgs e)
        {
            //Populate Cities from database
            IAddress       citiesList   = new AddressServices();
            IList <String> listOfCities = new List <String>();

            listOfCities = citiesList.GetCities();

            //Transfer to Model
            TheaterSearchView.Model.ListOfCities = new List <String>();
            TheaterSearchView.Model.ListOfCities = listOfCities;
        }
示例#4
0
        public async Task DeleteExistingAddressShouldReturnTrue()
        {
            var context         = InMemoryDatabase.GetDbContext();
            int idToDelete      = 3;
            var addressToDelete = GetTestData.FirstOrDefault(x => x.Id == idToDelete);

            var addressServices = new AddressServices(context);
            var actualResult    = await addressServices.DeleteAddressAsync(idToDelete);

            Assert.IsTrue(actualResult, ShouldReturnFalseMessage);
            Assert.That(addressToDelete.IsDeleted = true);
        }
示例#5
0
        public IHttpActionResult getAddress(int idUser)
        {
            int             codError    = 1;
            string          msjError    = "";
            AddressServices objServicio = new AddressServices();
            var             result      = objServicio.getAddress(idUser, ref codError, ref msjError);

            if (codError == 1)
            {
                return(Ok(result));
            }
            return(BadRequest(msjError));
        }
示例#6
0
        public IHttpActionResult setCreateAddress(AddressTO adrs)
        {
            int             codError    = 1;
            string          msjError    = "";
            AddressServices objServicio = new AddressServices();
            var             result      = objServicio.setCreateAddress(adrs, ref codError, ref msjError);

            if (codError == 1)
            {
                return(Ok(result));
            }
            return(BadRequest(msjError));
        }
示例#7
0
 public ResourcesController(ICoreOrderService orderService, IUserService userService, IPropertyService propertyService, IAccountServices accountServices, ILookupServices lookupServices,
                            IEmployeeServices employeeServices, ITenantLocationServices tenantLocationServices, IRolesServices rolesServices, IGroupsServices groupsServices, ContactNumbersServices contactNumberServices, AddressServices addressServices,
                            EmployeeShiftsStoresServices employeeShiftStoreServices, EmployeeRolesServices employeeRoleServices, EmployeeGroupsServices employeeGroupServices, IActivityServices activityServices)
     : base(orderService, propertyService, accountServices, lookupServices)
 {
     _employeeServices             = employeeServices;
     _tenantLocationsServices      = tenantLocationServices;
     _rolesServices                = rolesServices;
     _groupsServices               = groupsServices;
     _contactNumbersServices       = contactNumberServices;
     _addressServices              = addressServices;
     _employeeShiftsStoresServices = employeeShiftStoreServices;
     _employeeRolesServices        = employeeRoleServices;
     _employeeGroupsServices       = employeeGroupServices;
     _activityServices             = activityServices;
     _userService = userService;
 }
示例#8
0
        //	[Guid("4531D5B6-268C-4AB3-81EB-57D0845E21DF")]

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (this.LoadData != null)
                {
                    var ex = new EventArgs();
                    LoadData(ex);
                }

                Label1.Text = "it works, yeah!!!!";


                string theat     = Session["TheaterID"].ToString();
                Guid   theaterId = new Guid();
                theaterId = Guid.Parse(theat);



                TheaterServices showTheater    = new TheaterServices();
                TheaterModelDTO currentTheater = new TheaterModelDTO();
                currentTheater = showTheater.GetTheater(theaterId);

                lblName.Text = currentTheater.Name;


                AddressServices showAddress    = new AddressServices();
                AddressModelDTO currentAddress = new AddressModelDTO();

                currentAddress = showAddress.GetAddress(theaterId);

                lblAddressLine1.Text = currentAddress.AddressLine1;
                lblCity.Text         = currentAddress.City;
                lblCountry.Text      = currentAddress.Country;
                lblEmail.Text        = currentAddress.Email;
                lblPhone.Text        = currentAddress.Phone;
                lblPostalCode.Text   = currentAddress.PostalCode;
                lblProvince.Text     = currentAddress.Province;

                PerformanceServices showAllPerformances = new PerformanceServices();

                GridViewPerformance.DataSource = showAllPerformances.GetPerformances(theaterId);
                GridViewPerformance.DataBind();
            }
        }
示例#9
0
        //Method that extracts all data to populate the Labels and the table Performance
        private void LoadData(Guid theaterId)
        {
            //Data extraction from database

            IPerformance performanceServices = new PerformanceServices();
            IList <PerformanceModelDTO> ListOfPerformances = performanceServices.GetPerformances(theaterId);

            ITheater showTheater    = new TheaterServices();
            String   currentTheater = showTheater.GetTheater(theaterId);

            IAddress        showAddress    = new AddressServices();
            AddressModelDTO currentAddress = showAddress.GetAddress(theaterId);



            //Data transfer to Theater Model
            Myview.Model.ListOfPerformances = new List <PerformanceLine>();

            foreach (var item in ListOfPerformances)
            {
                PerformanceLine row = new PerformanceLine();
                row.PerformanceID = item.PerformanceID.ToString();
                row.Title         = item.Title;
                row.Date          = item.Date;
                row.StartingTime  = item.StartingTime;
                row.RoomNumber    = item.RoomNumber.ToString();
                row.Duration      = item.Duration;
                row.Price         = item.Price.ToString();
                Myview.Model.ListOfPerformances.Add(row);
            }

            Myview.Model.TheaterName  = currentTheater;
            Myview.Model.AddressLine1 = currentAddress.AddressLine1;
            Myview.Model.City         = currentAddress.City;
            Myview.Model.Country      = currentAddress.Country;
            Myview.Model.Province     = currentAddress.Province;
            Myview.Model.PostalCode   = currentAddress.PostalCode;
            Myview.Model.Phone        = currentAddress.Phone;
            Myview.Model.Email        = currentAddress.Email;
        }
示例#10
0
        public ServiceResponse PostProjectAndVerifyAddress(ProjectModel model)
        {
            AddressModel addressToVerify = model.ShipToAddress;

            if (addressToVerify.AddressLine1 != null)
            {
                AddressServices addressSvc = new AddressServices();
                ServiceResponse response   = addressSvc.VerifyAddress(model.ShipToAddress);
                if (response.IsOK)
                {
                    return(projectService.PostModel(this.CurrentUser, model));
                }
                else
                {
                    return(response);
                }
            }
            else
            {
                return(projectService.PostModel(this.CurrentUser, model));
            }
        }
示例#11
0
        public QueryResultSet<DAL.ResponseModel.AddressResponse> GetAddresses()
        {
            List<AddressResponse> addressResponseList = new List<AddressResponse>();
            QueryResultSet<AddressResponse> resultSet = new QueryResultSet<AddressResponse>();

            try
            {
                int addressStatus = Convert.ToInt32(Enums.AddressStatus.Active);
                var items = new AddressServices().dbContext.Address.Where(x => x.Status == addressStatus).ToList();

                if(items.Count >0)
                {
                    foreach(var item in items)
                    {
                        var itemResponse = new AddressServices().ToModelResponse(item);
                        addressResponseList.Add(itemResponse);
                    }

                    resultSet.IsResult = true;
                    resultSet.IsOperationSuccessful = true;
                    resultSet.ResultSet = addressResponseList;
                }
                else
                {
                    resultSet.IsOperationSuccessful = true;
                    resultSet.IsResult = false;
                    resultSet.ResultSet = null;
                }
            }
            catch(Exception ex)
            {
                resultSet.IsOperationSuccessful = false;
                resultSet.IsResult = false;
                resultSet.ResultSet = null;
            }

            return resultSet;
        }
 public void Delete(int id)
 {
     AddressServices.RemoveAddress(id);
 }
 public void Put(int id, [FromBody] JObject value)
 {
     Models.Address posted = value.ToObject <Models.Address>();
     posted.Id = id; // Ensure an id is attached
     AddressServices.UpdateAddress(posted);
 }
 public void Post([FromBody] JObject value)
 {
     Models.Address posted = value.ToObject <Models.Address>();
     AddressServices.AddAddress(posted);
 }
 public string Get(int id)
 {
     return(AddressServices.GetAddress(id));
 }