<file_sep>﻿using Acr.UserDialogs;
using CrossApp.PCL.ServiceModels;
using CrossApp.PCL.Services;
using CrossApp.PCL.ViewModels;
using MvvmCross.Core.ViewModels;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.ViewModels
{
    public class FindProjectViewModel : BaseViewModel
    {
        IUserDialogs _userDialog;
        IProjectService _projectService;

        public FindProjectViewModel(IUserDialogs userDialog, IProjectService projectService)
        {
            _projectService = projectService;
            _userDialog = userDialog;
        }

        private ObservableCollection<Project> _projects;
        public ObservableCollection<Project> Projects
        {
            get { return _projects; }
            set { if (_projects == value) return; _projects = value; RaisePropertyChanged(() => Projects); }
        }

        //Enum for spinner

        private Provinces province;
        public Provinces Province
        {
            get { return province; }
            set { if (province == value) return; province = value; RaisePropertyChanged(() => Province); }
        }

        private List<Provinces> provincesList = Enum.GetValues(typeof(Provinces)).Cast<Provinces>().ToList();
        public List<Provinces> ProvincesList
        {
            get { return provincesList; }
            set { if (provincesList == value) return; provincesList = value; RaisePropertyChanged(() => ProvincesList); }
        }

        private MvxAsyncCommand _searchCommand;
        public MvxAsyncCommand SearchCommand
        {
            get
            {
                _searchCommand = _searchCommand ?? new MvxAsyncCommand(DoSearchCommand);
                return _searchCommand;
            }
        }

        private async Task DoSearchCommand()
        {
            //using loading indicator, gets auto disposed after use
            using (_userDialog.Loading("Søger..", null, null, true, null))
            {
                try
                {
                    var result = await _projectService.GetAllProjects();
                    if (result != null)
                    {
                        Projects = new ObservableCollection<Project>(result);
                        return;
                    }
                }
                catch (Exception)
                {
                    await _userDialog.AlertAsync("Har du adgang til internettet?", "Der skete en fejl", "Jeg tjekker lige..", null);
                }
            }           
        }

        private MvxCommand<Project> _itemSelectedCommand;
        public MvxCommand<Project> ItemSelectedCommand
        {
            get
            {
                _itemSelectedCommand = _itemSelectedCommand ?? new MvxCommand<Project>(DoItemSelectedCommand);
                return _itemSelectedCommand;
            }
        }
        private void DoItemSelectedCommand(Project project)
        {
            var bundle = new MvxBundle();
            bundle.Data.Add("Id", project.Id.ToString());
            ShowViewModel<ProjectDetailsViewModel>(bundle);
        }

    }
}
<file_sep>
using Acr.UserDialogs;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Graphics;
using Android.OS;
using Android.Support.V4.View;
using Android.Support.V4.Widget;
using Android.Views;
using Android.Views.InputMethods;
using Android.Widget;
using CrossApp.PCL.ViewModels;
using MvvmCross.Droid.Support.V7.AppCompat;
using MvvmCross.Platform;
using MvvmCross.Platform.Droid.Platform;

namespace CrossApp.Droid.Activities
{
    [Activity(
        Label = "Job and Offer",
        Theme = "@style/AppTheme",
        LaunchMode = LaunchMode.SingleTop,
        Name = "crossapp.droid.activities.MainActivity"
    )]
    public class MainActivity : MvxCachingFragmentCompatActivity<MainViewModel>
    {
        public DrawerLayout DrawerLayout;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_main);

            UserDialogs.Init(() => Mvx.Resolve<IMvxAndroidCurrentTopActivity>().Activity);

            DrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
            if (bundle == null)
                ViewModel.ShowMenu();

        }

        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
                case Android.Resource.Id.Home:
                DrawerLayout.OpenDrawer(GravityCompat.Start);
                return true;
            }

            return base.OnOptionsItemSelected(item);
        }

        private void ShowBackButton()
        {
            //TODO Tell the toggle to set the indicator off
            //this.DrawerToggle.DrawerIndicatorEnabled = false;

            //Block the menu slide gesture
            DrawerLayout.SetDrawerLockMode(DrawerLayout.LockModeLockedClosed);
        }

        private void ShowHamburguerMenu()
        {
            //TODO set toggle indicator as enabled 
            //this.DrawerToggle.DrawerIndicatorEnabled = true;

            //Unlock the menu sliding gesture
            DrawerLayout.SetDrawerLockMode(DrawerLayout.LockModeUnlocked);
        }

        public override void OnBackPressed()
        {
            if (DrawerLayout != null && DrawerLayout.IsDrawerOpen(GravityCompat.Start))
                DrawerLayout.CloseDrawers();
            else
                base.OnBackPressed();
        }

        public void HideSoftKeyboard()
        {
            if (CurrentFocus == null) return;

            InputMethodManager inputMethodManager = (InputMethodManager)GetSystemService(InputMethodService);
            inputMethodManager.HideSoftInputFromWindow(CurrentFocus.WindowToken, 0);

            CurrentFocus.ClearFocus();
        }

        //Remove soft keyboard/focus from text field when tapping outside of it
        public override bool DispatchTouchEvent(MotionEvent ev)
        {
            if (ev.Action == MotionEventActions.Down)
            {
                System.Diagnostics.Debug.WriteLine("Tap!");
                View v = CurrentFocus;
                if (v.GetType() == typeof(EditText))
                {
                    Rect outRect = new Rect();
                    v.GetGlobalVisibleRect(outRect);
                    if (!outRect.Contains((int)ev.RawX, (int)ev.RawY))
                    {
                        v.ClearFocus();
                        HideSoftKeyboard();
                    }
                }
            }

            return base.DispatchTouchEvent(ev);
        }

    }
}<file_sep>﻿using MvvmCross.Core.ViewModels;

namespace CrossApp.PCL.ViewModels
{
    public class HomeViewModel : BaseViewModel
    {
        public HomeViewModel()
        {
        }

        public MvxCommand GoToInfoCommand
        {
            get { return new MvxCommand(() => System.Diagnostics.Debug.WriteLine("Knap blev trykket!")); }
        }
    }
}
<file_sep>﻿using CrossApp.PCL.ServiceModels;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.Services
{
    public interface IProjectService
    {
        Task<List<Project>> GetAllProjects();
        Task<Project> AddProject(Project project);
        Project FindProject(Project project);
        Task<Project> FindProjectById(Guid id);
        Project UpdateProject(Project project);
        bool DeleteProject(Project project);
    }

    public class ProjectService : IProjectService
    {

        public async Task<Project> AddProject(Project project)
        {
            HttpClient webservice = new HttpClient();
            string srObj = JsonConvert.SerializeObject(project);
            HttpContent httpContent = new StringContent(srObj, Encoding.UTF8, "application/json");

            HttpResponseMessage response = await webservice.PostAsync(MainService.BaseUrl + "Project/Post", httpContent);

            if (response.IsSuccessStatusCode)
            {
                string data = await response.Content.ReadAsStringAsync();
                var returnObj = JsonConvert.DeserializeObject<Project>(data);
                return returnObj;
            }
            return null;
        }

        public bool DeleteProject(Project project)
        {
            throw new NotImplementedException();
        }

        public Project FindProject(Project project)
        {
            throw new NotImplementedException();
        }

        public async Task<Project> FindProjectById(Guid id)
        {
            var webservice = new HttpClient();
            var result = await webservice.GetAsync(MainService.BaseUrl + "Project/GetById/" + id.ToString());
            var content = await result.Content.ReadAsStringAsync();

            var project = JsonConvert.DeserializeObject<Project>(content);

            return project;
        }

        public async Task<List<Project>> GetAllProjects()
        {
            var webservice = new HttpClient();
            var result = await webservice.GetAsync(MainService.BaseUrl + "Project/GetAll");
            var content = await result.Content.ReadAsStringAsync();

            var list = JsonConvert.DeserializeObject<List<Project>>(content);

            return list;
        }

        public Project UpdateProject(Project project)
        {
            throw new NotImplementedException();
        }
    }
}
<file_sep>﻿using JobAndOffer.Core.Models;
using JobAndOffer.Core.MongoDB;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JobAndOffer.BLL
{
    public class ProjectController
    {
        MongoContext db = new MongoContext();

        public async Task<List<Project>> GetAll()
        {
            return await db.Project.AsQueryable().ToListAsync();
        }

        public async Task<Project> Post(Project project)
        {
            await db.Project.InsertOneAsync(project);
            return project;
        }

        public Project Get(Project project)
        {
            return db.Project.AsQueryable().Where(s => s.Id == project.Id).FirstOrDefault();
        }

        public Project GetById(Guid id)
        {
            return db.Project.AsQueryable().Where(s => s.Id == id).FirstOrDefault();
        }

        public Project Put(Project project)
        {
            ReplaceOneResult results = db.Project.ReplaceOne(x => x.Id == project.Id, project);
            if (results.IsAcknowledged && results.ModifiedCount == 1)
            {
                return project;
            }
            return null;
        }

        public bool Delete(Project project)
        {
            DeleteResult results = db.Worker.DeleteOne(x => x.Id == project.Id);
            if (results.IsAcknowledged && results.DeletedCount == 1)
            {
                return true;
            }
            return false;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.ServiceModels
{
    public abstract class Person
    {
        public Person(string FirstName, string LastName, string City, int ZipCode, string Phone, string Email)
        {
            this.FirstName = FirstName;
            this.LastName = LastName;
            this.City = City;
            this.ZipCode = ZipCode;
            this.Phone = Phone;
            this.Email = Email;
        }

        public Guid Id { get; set; }

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public string City { get; set; }

        public int ZipCode { get; set; }

        public string Phone { get; set; }

        public string Email { get; set; }
    }
}
<file_sep>﻿using JobAndOffer.Core.Models;
using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;

namespace JobAndOffer.WCF
{
    [ServiceContract]
    public interface IJobAndOfferService
    {
        #region Worker
        [OperationContract]
        Worker AddWorker(Worker worker);
        [OperationContract]
        Worker FindWorker(Worker worker);
        [OperationContract]
        Worker FindWorkerById(Guid id);
        [OperationContract]
        Worker UpdateWorker(Worker worker);
        [OperationContract]
        bool DeleteWorker(Worker worker);
        #endregion

        #region Project
        [OperationContract]
        Project AddProject(Project project);
        [OperationContract]
        Project FindProject(Project project);
        [OperationContract]
        Project FindProjectById(Guid id);
        [OperationContract]
        Project UpdateProject(Project project);
        [OperationContract]
        bool DeleteProject(Project project);
        #endregion
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.ServiceModels
{
    public class Image
    {
        public Guid Id { get; set; }

        public byte[] ImageBytes { get; set; }

        public string ImageName { get; set; }

        //public Project Project { get; set; }

        public Guid ProjectId { get; set; }
    }
}
<file_sep>﻿using MvvmCross.Core.ViewModels;

namespace CrossApp.PCL.ViewModels
{
    public class BaseViewModel : MvxViewModel
    {
        protected BaseViewModel()
        {
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.ServiceModels
{
    public class Worker : Person
    {
        public Worker(string Username, string Password,
            string FirstName, string LastName, string City, int ZipCode, string Phone, string Email)
            : base(FirstName, LastName, City, ZipCode, Phone, Email)
        {
            this.Username = Username;
            this.Password = <PASSWORD>;
        }
        public string Username { get; set; }

        public string Password { get; set; }

        public List<Offer> Offers { get; set; }
    }
}
<file_sep>﻿//using JobAndOffer.Core.Interfaces;
//using JobAndOffer.Core.Models;
//using MongoDB.Bson;
//using MongoDB.Driver;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;

//namespace JobAndOffer.Core
//{
//    public class MDB<T> where T : IMongoModel
//    {
//        //MongoDB Connection
//        static MongoClient client = new MongoClient("mongodb://jobandoffer:<EMAIL>:47377/jobandoffer");

//        //Database
//        static IMongoDatabase db = client.GetDatabase("jobandoffer");

//        //Collection
//        IMongoCollection<T> mongoCollection;

//        public MDB(string collection)
//        {
//            mongoCollection = db.GetCollection<T>(collection);
//        }

//        public T Add(T entity)
//        {
//            mongoCollection.InsertOne(entity);
//            return entity;
//        }

//        public async Task<T> AddAsync(T entity)
//        {
//            await mongoCollection.InsertOneAsync(entity);
//            return entity;
//        }

//        public T Find(T entity)
//        {
//            var filter = Builders<T>.Filter.Eq(s => s.Id, entity.Id);
//            return mongoCollection.Find(filter).FirstOrDefault();
//        }

//        public async Task<T> FindAsync(T entity)
//        {
//            //FindOptions<T> options = new FindOptions<T> { Limit = 1 };
//            //IAsyncCursor<T> task = await mongoCollection.FindAsync(x => x.Id.Equals(entity.Id), options);
//            //return task.ToListAsync().Result.FirstOrDefault();
//            var filter = Builders<T>.Filter.Eq(s => s.Id, entity.Id);
//            return await mongoCollection.Find(filter).FirstOrDefaultAsync();
//        }

//        public T FindById(string id)
//        {
//            var filter = Builders<T>.Filter.Eq(s => s.Id, id);
//            return mongoCollection.Find(filter).FirstOrDefault();
//        }

//        public async Task<T> FindByIdAsync(string id)
//        {
//            var filter = Builders<T>.Filter.Eq(s => s.Id, id);
//            return await mongoCollection.Find(filter).FirstOrDefaultAsync();
//        }

//        public T Update(T entity)
//        {
//            var filter = Builders<T>.Filter.Eq(s => s.Id, entity.Id);
//            ReplaceOneResult result = mongoCollection.ReplaceOne(filter, entity);
//            if (result.IsAcknowledged && result.ModifiedCount == 1)
//            {
//                return entity;
//            }
//            return default(T);
//        }

//        public async Task<T> UpdateAsync(T entity)
//        {
//            var filter = Builders<T>.Filter.Eq(s => s.Id, entity.Id);
//            ReplaceOneResult result = await mongoCollection.ReplaceOneAsync(filter, entity);
//            if (result.IsAcknowledged && result.ModifiedCount == 1)
//            {
//                return entity;
//            }
//            return default(T);
//        }

//        public bool Delete(T entity)
//        {
//            var filter = Builders<T>.Filter.Eq(s => s.Id, entity.Id);
//            DeleteResult result = mongoCollection.DeleteOne(filter);
//            if (result.IsAcknowledged && result.DeletedCount == 1)
//            {
//                return true;
//            }
//            return false;
//        }

//        public async Task<bool> DeleteAsync(T entity)
//        {      
//            var filter = Builders<T>.Filter.Eq(s => s.Id, entity.Id);
//            DeleteResult result = await mongoCollection.DeleteOneAsync(filter);
//            if(result.IsAcknowledged && result.DeletedCount == 1)
//            {
//                return true;
//            }         
//            return false;
//        }

//    }
//}

<file_sep>using Android.Runtime;
using CrossApp.PCL.ViewModels;
using Android.OS;
using Android.Views;
using MvvmCross.Droid.Shared.Attributes;

namespace CrossApp.Droid.Fragments.FindProject
{
    [MvxFragment(typeof(MainViewModel), Resource.Id.content_frame)]
    [Register("crossapp.droid.fragments.ProjectDetailsFragment")]
    public class ProjectDetailsFragment : BaseFragment<ProjectDetailsViewModel>
    {
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ShowHamburgerMenu = true;
            return base.OnCreateView(inflater, container, savedInstanceState);
        }

        protected override int FragmentId => Resource.Layout.fragment_project_details;
    }
}<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.Services
{
    public static class MainService
    {
        private static string _baseUrl = "http://jobandoffer.boligbuen.dk/";
        public static string BaseUrl
        {
            get
            {
                return _baseUrl;
            }
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MvvmCross.Core.ViewModels;
using CrossApp.PCL.ViewModels;

namespace CrossApp.PCL
{
    class AppStart : MvxNavigatingObject, IMvxAppStart
    {
        public void Start(object hint = null)
        {
            ShowViewModel<MainViewModel>();
        }
    }
}
<file_sep>﻿using Acr.UserDialogs;
using MvvmCross.Core.ViewModels;
using System;

namespace CrossApp.PCL.ViewModels
{
    public class MenuViewModel : BaseViewModel
    {

        IUserDialogs _userDialog;

        public MenuViewModel (IUserDialogs userDialog)
        {
            _userDialog = userDialog;
        }

        //Home
        public IMvxCommand ShowHomeCommand
        {
            get { return new MvxCommand(ShowHomeExecuted); }
        }

        private void ShowHomeExecuted()
        {
            ShowViewModel<HomeViewModel>();
        }

        //Create Job
        public IMvxCommand ShowCreateProjectCommand
        {
            get { return new MvxCommand(ShowCreateProjectExecuted); }
        }

        private void ShowCreateProjectExecuted()
        {
            ShowViewModel<CreateProjectViewModel>();
        }

        //Find job
        public IMvxCommand ShowFindProjectCommand
        {
            get { return new MvxCommand(ShowFindProjectExecuted); }
        }

        private void ShowFindProjectExecuted()
        {
            ShowViewModel<FindProjectViewModel>();
        }

        //Opret bruger
        public IMvxCommand ShowUserLogin
        {
            get { return new MvxCommand(DoUserLogin); }
        }

        private void DoUserLogin()
        {
            LoginConfig config = new LoginConfig();
            config.CancelText = "Fortryd";
            config.LoginPlaceholder = "Brugernavn";
            config.OkText = "Log ind";
            config.PasswordPlaceholder = "<PASSWORD>";
            config.Title = "Log ind";
            config.OnAction = _loginMethod;

            _userDialog.Login(config);
        }

        private void _loginMethod(LoginResult res)
        {
            _userDialog.Alert("Du har forsøgt at logge ind som: " + res.LoginText + " med kode: " + res.Password);
        }




    }
}<file_sep>﻿using JobAndOffer.Core.Interfaces;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace JobAndOffer.Core.Models
{
    [DataContract]
    public class Image : IMongoModel
    {
        [DataMember, BsonId]
        public Guid Id { get; set; }

        [DataMember]
        public byte[] ImageBytes { get; set; }

        [DataMember]
        public string ImageName { get; set; }

        [BsonIgnore]
        public Project Project { get; set; }

        [DataMember, BsonIgnore]
        public Guid ProjectId { get; set; }
    }
}<file_sep>﻿using JobAndOffer.Core.Interfaces;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace JobAndOffer.Core.Models
{
    [DataContract]
    public abstract class Person : IMongoModel
    {
        public Person(string FirstName, string LastName, string City, int ZipCode, string Phone, string Email)
        {
            this.FirstName = FirstName;
            this.LastName = LastName;
            this.City = City;
            this.ZipCode = ZipCode;
            this.Phone = Phone;
            this.Email = Email;
        }

        [DataMember, BsonId]
        //[BsonRepresentation(BsonType.ObjectId)]
        public Guid Id { get; set; }

        [DataMember]
        public string FirstName { get; set; }

        [DataMember]
        public string LastName { get; set; }

        [DataMember]
        public string City { get; set; }

        [DataMember]
        public int ZipCode { get; set; }

        [DataMember]
        public string Phone { get; set; }

        [DataMember]
        public string Email { get; set; }
    }
}<file_sep>﻿using JobAndOffer.Core.Interfaces;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace JobAndOffer.Core.Models
{
    [DataContract]
    public class Offer : IMongoModel
    {
        [DataMember, BsonId]
        public Guid Id { get; set; }

        [DataMember]
        public double OfferPrice { get; set; }

        [DataMember]
        public string OfferDescription { get; set; }

        [DataMember]
        public DateTime EstimatedTime { get; set; }

        [DataMember]
        public Project Project { get; set; }

        [DataMember]
        public Worker Worker { get; set; }
    }
}<file_sep>﻿using MvvmCross.Platform.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;
using CrossApp.PCL.ServiceModels;

namespace CrossApp.PCL.Converters
{
    public class JobTypesToStringValueConverter : MvxValueConverter<List<JobTypes>, string>
    {
        protected override string Convert(List<JobTypes> value, Type targetType, object parameter, CultureInfo culture)
        {
            var returnString = "";
            int i = 0;

            foreach (var item in value)
            {
                returnString += item.ToString();
                if ((i+1) != value.Count)
                    returnString += ", ";
                i++;
            }
            return returnString;
        }
    }
}
<file_sep>﻿using CrossApp.PCL.ServiceModels;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.Services
{
    public interface IWorkerService
    {
        Task<List<Worker>> GetAllWorkers();
        Worker AddWorker(Worker worker);
        Worker FindWorker(Worker worker);
        Worker FindWorkerById(Guid id);
        Worker UpdateWorker(Worker worker);
        bool DeleteWorker(Worker worker);
    }

    public class WorkerService : IWorkerService
    {

        public Worker AddWorker(Worker worker)
        {
            throw new NotImplementedException();
        }

        public bool DeleteWorker(Worker worker)
        {
            throw new NotImplementedException();
        }

        public Worker FindWorker(Worker worker)
        {
            throw new NotImplementedException();
        }

        public Worker FindWorkerById(Guid id)
        {
            throw new NotImplementedException();
        }

        public async Task<List<Worker>> GetAllWorkers()
        {
            var webservice = new HttpClient();
            var result = await webservice.GetAsync( MainService.BaseUrl + "api/Worker/GetAllWorkers" );
            var content = await result.Content.ReadAsStringAsync();

            var list = JsonConvert.DeserializeObject<List<Worker>>(content);

            return list;
        }

        public Worker UpdateWorker(Worker worker)
        {
            throw new NotImplementedException();
        }
    }
}
<file_sep>﻿using MvvmCross.Platform.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Globalization;

namespace CrossApp.PCL.Converters
{
    public class DateTimeToStringValueConverter : MvxValueConverter<DateTime, string>
    {
        protected override string Convert(DateTime value, Type targetType, object parameter, CultureInfo culture)
        {
            return value.ToString("dd/MM/yyyy");
        }
    }
}
<file_sep>﻿using Acr.UserDialogs;
using CrossApp.PCL.ServiceModels;
using CrossApp.PCL.Services;
using MvvmCross.Core.ViewModels;
using MvvmCross.Platform;
using MvvmCross.Plugins.PictureChooser;
using Splat;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.ViewModels
{
    public class CreateProjectViewModel : BaseViewModel
    {
        IUserDialogs _userDialog;
        IProjectService _projectService;
        IMvxPictureChooserTask _pictureChooserTask;

        public CreateProjectViewModel(IUserDialogs userDialog,
                    IProjectService projectService,
                    IMvxPictureChooserTask pictureChooserTask)
        {
            _projectService = projectService;
            _userDialog = userDialog;
            _pictureChooserTask = pictureChooserTask;
        }

        //Instance variables
        private string projectTitle = "";
        public string ProjectTitle
        {
            get { return projectTitle; }
            set { if (projectTitle == value) return; projectTitle = value; RaisePropertyChanged(() => ProjectTitle); }
        }


        private string projectDescription = "";
        public string ProjectDescription
        {
            get { return projectDescription; }
            set { if (projectDescription == value) return; projectDescription = value; RaisePropertyChanged(() => ProjectDescription); }
        }


        private DateTime createdDate = DateTime.Now;
        public DateTime CreatedDate
        {
            get { return createdDate; }
            set { createdDate = value; RaisePropertyChanged(() => CreatedDate); }
        }

        private DateTime expireDate = DateTime.Now;
        public DateTime ExpireDate
        {
            get { return expireDate; }
            set { expireDate = value; RaisePropertyChanged(() => ExpireDate); }
        }

        private ObservableCollection<Image> images = new ObservableCollection<Image>();
        public ObservableCollection<Image> Images
        {
            get { return images; }
            set { if (images == value) return; images = value; RaisePropertyChanged(() => Images); }
        }

        //Enum for spinner

        private Provinces province;
        public Provinces Province
        {
            get { return province; }
            set { if (province == value) return; province = value; RaisePropertyChanged(() => Province); }
        }

        private List<Provinces> provincesList = Enum.GetValues(typeof(Provinces)).Cast<Provinces>().ToList();
        public List<Provinces> ProvincesList
        {
            get { return provincesList; }
            set { if (provincesList == value) return; provincesList = value; RaisePropertyChanged(() => ProvincesList); }
        }

        //Job types
        HashSet<JobTypes> _jobTypes = new HashSet<JobTypes>();

        private bool _carpenter = false;
        public bool Carpenter
        {
            get { return _carpenter; }
            set {
                    if (_carpenter == false) _jobTypes.Add(JobTypes.Tømrer);
                    if (_carpenter == true) _jobTypes.Remove(JobTypes.Tømrer);
                    _carpenter = value;
                    RaisePropertyChanged(() => Carpenter);
                }
        }

        private bool _mason = false;
        public bool Mason
        {
            get { return _mason; }
            set
            {
                if (_mason == false) _jobTypes.Add(JobTypes.Murer);
                if (_mason == true) _jobTypes.Remove(JobTypes.Murer);
                _mason = value;
                RaisePropertyChanged(() => Mason);
            }
        }

        private bool _plumber = false;
        public bool Plumber
        {
            get { return _plumber; }
            set
            {
                if (_plumber == false) _jobTypes.Add(JobTypes.VVS);
                if (_plumber == true) _jobTypes.Remove(JobTypes.VVS);
                _plumber = value;
                RaisePropertyChanged(() => Plumber);
            }
        }

        private bool _electrician = false;
        public bool Electrician
        {
            get { return _electrician; }
            set
            {
                if (_electrician == false) _jobTypes.Add(JobTypes.Elektriker);
                if (_electrician == true) _jobTypes.Remove(JobTypes.Elektriker);
                _electrician = value;
                RaisePropertyChanged(() => Electrician);
            }
        }

        private bool _transport = false;
        public bool Transport
        {
            get { return _transport; }
            set
            {
                if (_transport == false) _jobTypes.Add(JobTypes.Transport);
                if (_transport == true) _jobTypes.Remove(JobTypes.Transport);
                _transport = value;
                RaisePropertyChanged(() => Transport);
            }
        }

        private bool _miscellaneous = false;
        public bool Miscellaneous
        {
            get { return _miscellaneous; }
            set
            {
                if (_miscellaneous == false) _jobTypes.Add(JobTypes.Andet);
                if (_miscellaneous == true) _jobTypes.Remove(JobTypes.Andet);
                _miscellaneous = value;
                RaisePropertyChanged(() => Miscellaneous);
            }
        }



        //End of instances variables
        //Methods

        private MvxCommand createdDateDialog;
        public MvxCommand CreatedDateDialog
        {
            get
            {
                createdDateDialog = createdDateDialog ?? new MvxCommand(DoCreatedDateDialog);
                return createdDateDialog;
            }
        }

        private async void DoCreatedDateDialog()
        {
            DatePromptConfig cnf = new DatePromptConfig();
            cnf.SelectedDate = CreatedDate;
            cnf.MinimumDate = DateTime.Now;
            cnf.CancelText = "Fortryd";
            cnf.IsCancellable = true;
            cnf.OkText = "Ok";

            var result = await _userDialog.DatePromptAsync(cnf);
            if (result.Ok)
                CreatedDate = result.SelectedDate;
        }

        private MvxCommand expireDateDialog;
        public MvxCommand ExpireDateDialog
        {
            get
            {
                expireDateDialog = expireDateDialog ?? new MvxCommand(DoExpireDateDialog);
                return expireDateDialog;
            }
        }

        private async void DoExpireDateDialog()
        {
            DatePromptConfig cnf = new DatePromptConfig();
            cnf.SelectedDate = ExpireDate;
            cnf.MinimumDate = DateTime.Now.AddDays(1);
            cnf.CancelText = "Fortryd";
            cnf.IsCancellable = true;
            cnf.OkText = "Ok";

            var result = await _userDialog.DatePromptAsync(cnf);
            if (result.Ok)
                ExpireDate = result.SelectedDate;
        }


        //Picture taking -----

        private MvxCommand choosePictureSourceCommand;

        public MvxCommand ChoosePictureSourceCommand
        {
            get
            {
                choosePictureSourceCommand = choosePictureSourceCommand ?? new MvxCommand(DoChoosePictureSourceCommand);
                return choosePictureSourceCommand;
            }
        }

        private async void DoChoosePictureSourceCommand()
        {
            ActionSheetConfig con = new ActionSheetConfig();

            ActionSheetOption library = new ActionSheetOption("Fra bibliotek", DoChoosePicture, await BitmapLoader.Current.LoadFromResource("album", null, null));
            ActionSheetOption camera = new ActionSheetOption("Fra kamera", DoTakePicture, await BitmapLoader.Current.LoadFromResource("camera", null, null));
            ActionSheetOption cancel = new ActionSheetOption("Fortryd", null, await BitmapLoader.Current.LoadFromResource("cancel", null, null));

            con.UseBottomSheet = true;
            con.Title = "Vælg et billede..";
            con.Options = new List<ActionSheetOption> { library, camera, cancel };
            _userDialog.ActionSheet(con);
        }


        private void DoTakePicture()
        {
            _pictureChooserTask.TakePicture(400, 95, OnPicture, () => { });
        }

        private void DoChoosePicture()
        {
            _pictureChooserTask.ChoosePictureFromLibrary(400, 95, OnPicture, () => { });
        }

        private void OnPicture(Stream pictureStream)
        {
            var memoryStream = new MemoryStream();
            pictureStream.CopyTo(memoryStream);

            Image image = new Image
            {
                ImageBytes = memoryStream.ToArray(),
                ImageName = "Billede " + (Images.Count + 1),
                Id = Guid.NewGuid()
            };
            Images.Add(image);
        }

        //End of picture taking ----

        private MvxAsyncCommand createProject;
        public MvxAsyncCommand CreateProject
        {
            get
            {
                createProject = createProject ?? new MvxAsyncCommand(CreateProjectMethod);
                return createProject;
            }
        }

        private async Task CreateProjectMethod()
        {
            //using loading indicator, gets auto disposed after use
            using (_userDialog.Loading("Opretter..", null, null, true, null))
            {
                Project project = new Project
                {
                    CreatedDate = createdDate,
                    ExpireDate = expireDate,
                    ProjectTitel = projectTitle,
                    ProjectDescription = projectDescription,
                    Images = images.ToList(),
                    Province = province,
                    JobType = _jobTypes.ToList()
                };
                try
                {
                    if (await _projectService.AddProject(project) != null)
                    {
                        CleanFields();
                        AlertDialog("Dit job er oprettet!", "Oprettelse udført", "Super");
                        return;
                    }
                    AlertDialog("Der er sket en fejl!", "Fejl", "Ok");
                }
                catch (Exception)
                {
                    AlertDialog("Der er sket en fejl!", "Fejl", "Ok");
                }
            }
                
        }

        private void CleanFields()
        {
            ProjectTitle = "";
            ProjectDescription = "";
            CreatedDate = DateTime.Today;
            ExpireDate = DateTime.Today;
            Images = new ObservableCollection<Image>();
            Province = Provinces.KøbenhavnsBy;
            Mason = Carpenter = Plumber = Electrician = Transport = Miscellaneous = false;
            _jobTypes = new HashSet<JobTypes>();
        }

        //Might gonna be moved to another class
        private async void AlertDialog(string msg, string title, string okText)
        {            
            await _userDialog.AlertAsync(msg, title, okText, null);
        }

    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace CrossApp.PCL.ServiceModels
{
    public class Project
    {
        public Guid Id { get; set; }

        public List<Offer> Offers { get; set; }

        public string ProjectDescription { get; set; }

        public string ProjectTitel { get; set; }

        public List<Image> Images { get; set; }

        public DateTime CreatedDate { get; set; }

        public DateTime ExpireDate { get; set; }

        public Provinces Province { get; set; }

        public List<JobTypes> JobType { get; set; }

        public Image FirstImage { get {
                if (Images != null && Images.Count > 0) return Images.FirstOrDefault(); return null;
            } }

        //static readonly Dictionary<Provinces, string> ProvinceNames = new Dictionary<Provinces, string>
        //{
        //    { Provinces.KøbenhavnsBy, "Københavns By" },
        //    { Provinces.KøbenhavnsOmegn, "Københavns omegn" },
        //    { Provinces.Nordsjælland, "Nordsjælland" },
        //    { Provinces.Bornholm, "Bornholm" },
        //    { Provinces.Østsjælland, "Østsjælland" },
        //    { Provinces.VestOgSydsjælland, "Vest- & Sydsjælland" },
        //    { Provinces.Fyn, "Fyn" },
        //    { Provinces.Sydjylland, "Sydjylland" },
        //    { Provinces.Vestjylland, "Vestjylland" },
        //    { Provinces.Østjylland, "Østjylland" },
        //    { Provinces.Nordjylland, "Nordjylland" },
        //};
        //public static string ConvertProvinces(Provinces province)
        //{
        //    string name;
        //    return (ProvinceNames.TryGetValue(province, out name)) ? name : province.ToString();
        //}
    }

    public enum Provinces
    {
        KøbenhavnsBy = 0,
        KøbenhavnsOmegn = 1,
        Nordsjælland = 2,
        Bornholm = 3,
        Østsjælland = 4,
        VestOgSydsjælland = 5,
        Fyn = 6,
        Sydjylland = 7,
        Vestjylland = 8,
        Østjylland = 9,
        Nordjylland = 10,
    }

    public enum JobTypes
    {
        Murer = 0,
        Tømrer = 1,
        VVS = 2,
        Elektriker = 3,
        Transport = 4,
        Andet = 5
    }
}
<file_sep>using Android.Runtime;
using CrossApp.PCL.ViewModels;
using Android.OS;
using Android.Views;
using MvvmCross.Droid.Shared.Attributes;
using Android.Views.InputMethods;
using MvvmCross.Binding.Droid.Views;
using Android.InputMethodServices;
using Acr.UserDialogs;

namespace CrossApp.Droid.Fragments
{
    [MvxFragment(typeof(MainViewModel), Resource.Id.content_frame)]
    [Register("crossapp.droid.fragments.CreateProjectFragment")]
    public class CreateProjectFragment : BaseFragment<CreateProjectViewModel>
    {

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ShowHamburgerMenu = true;
            return base.OnCreateView(inflater, container, savedInstanceState);
        }

        protected override int FragmentId => Resource.Layout.fragment_create_project;

    }
}<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace JobAndOffer.Core.Models
{
    [DataContract]
    public class Customer : Person
    {
        public Customer (string FirstName, string LastName, string City, int ZipCode, string Phone, string Email)
            : base(FirstName, LastName, City, ZipCode, Phone, Email)
        {

        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using JobAndOffer.Core.Models;
using System.Threading.Tasks;
using MongoDB.Bson;
using JobAndOffer.Core;
using JobAndOffer.Core.MongoDB;
using MongoDB.Driver.Linq;
using MongoDB.Driver;
using System.Linq.Expressions;

namespace JobAndOffer.WCF
{
    public class JobAndOfferService : IJobAndOfferService
    {
        MongoContext db = new MongoContext();

        #region Worker
        public Worker AddWorker(Worker worker)
        {
            db.Worker.InsertOne(worker);
            return worker;
        }

        //public async Task<Worker> AddWorkerAsync(Worker worker)
        //{
        //    await db.Worker.InsertOneAsync(worker);
        //    return worker;
        //}

        public Worker FindWorker(Worker worker)
        {
            return db.Worker.AsQueryable().Where(s => s.Id == worker.Id).FirstOrDefault();
        }

        //public async Task<Worker> FindWorkerAsync(Worker worker)
        //{
        //    return await db.Worker.AsQueryable().Where(s => s.Id == worker.Id).FirstOrDefaultAsync();
        //}

        public Worker FindWorkerById(Guid id)
        {
            return db.Worker.AsQueryable().Where(s => s.Id == id).FirstOrDefault();
        }

        //public async Task<Worker> FindWorkerByIdAsync(Guid id)
        //{
        //    return await db.Worker.AsQueryable().Where(s => s.Id == id).FirstOrDefaultAsync();
        //}

        public Worker UpdateWorker(Worker worker)
        {
            ReplaceOneResult results = db.Worker.ReplaceOne(x => x.Id == worker.Id, worker);
            if (results.IsAcknowledged && results.ModifiedCount == 1)
            {
                return worker;
            }
            return null;
        }

        //public async Task<Worker> UpdateWorkerAsync(Worker worker)
        //{
        //    ReplaceOneResult results = await db.Worker.ReplaceOneAsync(x => x.Id == worker.Id, worker);
        //    if (results.IsAcknowledged && results.ModifiedCount == 1)
        //    {
        //        return worker;
        //    }
        //    return null;
        //}

        public bool DeleteWorker(Worker worker)
        {
            DeleteResult results = db.Worker.DeleteOne(x => x.Id == worker.Id);
            if (results.IsAcknowledged && results.DeletedCount == 1)
            {
                return true;
            }
            return false;
        }

        //public async Task<bool> DeleteWorkerAsync(Worker worker)
        //{
        //    DeleteResult results =  await db.Worker.DeleteOneAsync(x => x.Id == worker.Id);
        //    if(results.IsAcknowledged && results.DeletedCount == 1)
        //    {
        //        return true;
        //    }
        //    return false;
        //}
        #endregion

        #region Project
        public Project AddProject(Project project)
        {
            db.Project.InsertOneAsync(project);
            return project;
        }

        public Project FindProject(Project project)
        {
            throw new NotImplementedException();
        }

        public Project FindProjectById(Guid id)
        {
            throw new NotImplementedException();
        }

        public Project UpdateProject(Project project)
        {
            throw new NotImplementedException();
        }

        public bool DeleteProject(Project project)
        {
            throw new NotImplementedException();
        }
        #endregion
    }
}
<file_sep>﻿using JobAndOffer.Core.Models;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace JobAndOffer.Core.MongoDB
{
    public class MongoContext
    {
        private IMongoDatabase db;
        private MongoClient client;

        public MongoContext()
        {
            client = new MongoClient("mongodb://jobandoffer:<EMAIL>:47377/jobandoffer");
            db = client.GetDatabase("jobandoffer");
        }

        public IMongoCollection<Worker> Worker
        {
            get
            {
                return db.GetCollection<Worker>("Worker");
            }
        }

        public IMongoCollection<Project> Project
        {
            get
            {
                return db.GetCollection<Project>("Project");
            }
        }

    }
}
<file_sep>﻿using Acr.UserDialogs;
using CrossApp.PCL.ServiceModels;
using CrossApp.PCL.Services;
using MvvmCross.Core.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;

namespace CrossApp.PCL.ViewModels
{
    public class ProjectDetailsViewModel : MvxViewModel
    {
        private Guid _id;

        IUserDialogs _userDialog;
        IProjectService _projectService;

        public ProjectDetailsViewModel(IUserDialogs userDialog, IProjectService projectService)
        {
            _projectService = projectService;
            _userDialog = userDialog;
        }

        protected override void InitFromBundle(IMvxBundle parameters)
        {
            base.InitFromBundle(parameters);

            string id;
            if (parameters.Data.TryGetValue("Id", out id))
            {
                _id = new Guid(id);
            }
            else
            {
                throw new ArgumentException("Missing id");
            }
        }

        public override async void Start()
        {
            base.Start();
            //using loading indicator, gets auto disposed after use
            using (_userDialog.Loading("Henter..", null, null, true, null))
            {
                try
                {
                    var result = await _projectService.FindProjectById(_id);
                    if (result != null)
                    {
                        CurrentProject = result;
                        System.Diagnostics.Debug.WriteLine("First image property: " + FirstImage.ImageName);
                    }
                }
                catch (Exception)
                {
                    await _userDialog.AlertAsync("Har du adgang til internettet?", "Der skete en fejl", "Jeg tjekker lige..", null);
                }
            }
            
        }

        private string _username;
        private int _priceOffer;

        private Project _currentProject;
        public Project CurrentProject
        {
            get { return _currentProject; }
            set
            {
                _currentProject = value;

                RaisePropertyChanged(() => CurrentProject);
                RaisePropertyChanged(() => Title);
                RaisePropertyChanged(() => Description);
                RaisePropertyChanged(() => Images);
                RaisePropertyChanged(() => CreatedDate);
                RaisePropertyChanged(() => ExpireDate);
                RaisePropertyChanged(() => Province);
                RaisePropertyChanged(() => JobType);
                RaisePropertyChanged(() => FirstImage);
            }
        }

        public string Title { get { return CurrentProject.ProjectTitel; } }

        public string Description { get { return CurrentProject.ProjectDescription; } }

        public List<Image> Images { get { return CurrentProject.Images; } }

        public DateTime CreatedDate { get { return CurrentProject.CreatedDate; } }

        public DateTime ExpireDate { get { return CurrentProject.ExpireDate; } }

        public Provinces Province { get { return CurrentProject.Province; } }

        public List<JobTypes> JobType { get { return CurrentProject.JobType; } }

        public Image FirstImage { get { return CurrentProject.Images.FirstOrDefault(); } }

        private MvxCommand _navBack;

        public MvxCommand NavBack
        {
            get
            {
                _navBack = _navBack ?? new MvxCommand(DoNavBack);
                return _navBack;
            }
        }

        private void DoNavBack()
        {
            ShowViewModel<FindProjectViewModel>();
        }

        private MvxCommand _makeOffer;

        public MvxCommand MakeOffer
        {
            get
            {
                _makeOffer = _makeOffer ?? new MvxCommand(DoMakeOffer);
                return _makeOffer;
            }
        }

        private void DoMakeOffer()
        {
            PromptConfig config = new PromptConfig();
            config.CancelText = "Cancel";
            config.IsCancellable = true;
            config.Message = "Angiv brugernavn";
            config.OkText = "Ok";
            config.Title = "Angiv bud";
            config.InputType = InputType.Name;
            config.OnAction = _onAction;

            _userDialog.Prompt(config);
        }

        private void _onAction(PromptResult res)
        {
            if (res.Ok)
            {
                _username = res.Text;
                _userDialog.Alert("Vi har gemt dit navn");
            }
            else if (!res.Ok)
            {
                _userDialog.Alert("Du trykkede fortryd");
            }

        }


    }
}
<file_sep>﻿using JobAndOffer.Core.Models;
using JobAndOffer.Core.MongoDB;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace JobAndOffer.WebAPI.Controllers
{
    [RoutePrefix("Worker")]
    public class WorkerController : ApiController
    {
        MongoContext db = new MongoContext();

        [HttpGet]
        [Route("GetAll")]
        public async Task<List<Worker>> GetAll()
        {
            return await db.Worker.AsQueryable().ToListAsync();
        }
        [HttpGet]
        [Route("Far")]
        public string Test()
        {
            return "Hej far";
        }

        [HttpPost]
        public Worker Post(Worker worker)
        {
            db.Worker.InsertOne(worker);
            return worker;
        }

        public Worker Get(Worker worker)
        {
            return db.Worker.AsQueryable().Where(s => s.Id == worker.Id).FirstOrDefault();
        }

        public Worker Get(Guid id)
        {
            return db.Worker.AsQueryable().Where(s => s.Id == id).FirstOrDefault();
        }

        [HttpPut]
        public Worker Put(Worker worker)
        {
            ReplaceOneResult results = db.Worker.ReplaceOne(x => x.Id == worker.Id, worker);
            if (results.IsAcknowledged && results.ModifiedCount == 1)
            {
                return worker;
            }
            return null;
        }

        [HttpDelete]
        public bool Delete(Worker worker)
        {
            DeleteResult results = db.Worker.DeleteOne(x => x.Id == worker.Id);
            if (results.IsAcknowledged && results.DeletedCount == 1)
            {
                return true;
            }
            return false;
        }
    }
}
<file_sep>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrossApp.PCL.ServiceModels
{
    public class Offer
    {
        public Guid Id { get; set; }

        public double OfferPrice { get; set; }
        public string OfferDescription { get; set; }

        public DateTime EstimatedTime { get; set; }

        public Project Project { get; set; }

        public Worker Worker { get; set; }
    }
}
<file_sep>﻿using JobAndOffer.Core.Models;
using JobAndOffer.Core.MongoDB;
using JobAndOffer.BLL;
using MongoDB.Driver;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;

namespace JobAndOffer.WebAPI.Controllers
{
    [RoutePrefix("Project")]
    public class ProjectController : ApiController
    {
        BLL.ProjectController projectController = new BLL.ProjectController();

        [HttpGet]
        [Route("GetAll")]
        public async Task<List<Project>> GetAllProjects()
        {
            return await projectController.GetAll();
        }

        [HttpPost]
        [Route("Post")]
        public async Task<Project> PostProject(Project project)
        {
            return await projectController.Post(project);
        }
        [HttpGet]
        [Route("Get")]
        public Project GetProject(Project project)
        {
            return projectController.Get(project);
        }

        [HttpGet]
        [Route("GetById/{id}")]
        public Project GetProjectById(string id)
        {
            return projectController.GetById(new Guid(id));
        }

        [HttpPut]
        [Route("Put")]
        public Project PutProject(Project project)
        {
            return projectController.Put(project);
        }

        [HttpDelete]
        [Route("Delete")]
        public bool DeleteProject(Project project)
        {
            return projectController.Delete(project);
        }
    }
}
