How do I make an app where I can send information to the app from the main application that I will write?
Anonymous in /c/coding_help
82
report
The task I am dealing with is to write an app for a family business. <br><br>It is a tour company. We need to keep track of which tour, guide, customer, and restaurant are connected to each other. <br><br>For example, a guide is linked to a tour, a customer is linked to a tour and a restaurant is linked to a customer. <br><br>I also want to be able to log in as a guide, customer and administrators. <br><br>Log in should be an email and a password (I know you shouldn't use a password, but I want to stay simple). <br><br>I was thinking of making the main application that holds this data in C#, because I am quite familiar with it. It should be a console application. <br><br>However, I want the app to be able to present this data without having to log in to the main application. <br><br>My theory is that when a guide logs in to the app, the app should send information to the main application about the guide's email and password. <br><br>Then the main application should verify this information and then send back the correct information about which tour, customer and restaurant this guide is linked to. <br><br>I was also thinking of having all the data in classes in the main application. <br><br>Here is an example of the classes (the code is in Swedish as it is a Swedish company):<br><br>public class Restaurang<br>{<br> public List<Tur> Turer = new();<br> public string Namn { get; set; }<br><br> public Restaurang(string Namn)<br> {<br> this.Namn = Namn;<br> }<br>}<br><br>public class Kunde<br>{<br> public string ForNamn { get; set; }<br> public string EfterNamn { get; set; }<br> public string Email { get; set; }<br> public string Password { get; set; }<br> public DateTime Fodd { get; set; }<br> public Tur Turen { get; set; }<br> public Restaurang Restaurangen { get; set; }<br> public bool Verificerad { get; set; } = false;<br> public bool Admin { get; set; } = false;<br><br> public Kunde(string forNamn, string efterNamn, string email, string password, DateTime fodd)<br> {<br> ForNamn = forNamn;<br> EfterNamn = efterNamn;<br> Email = email;<br> Password = password;<br> Fodd = fodd;<br> }<br>}<br><br>public class Guide : Kunde<br>{<br> public Tur Turen { get; set; }<br> public bool Verificerad { get; set; } = false;<br> public bool Admin { get; set; } = false;<br><br> public Guide(string forNamn, string efterNamn, string email, string password, DateTime fodd)<br> : base(forNamn, efterNamn, email, password, fodd)<br> {<br><br> }<br>}<br><br>public class Admin : Kunde<br>{<br> public bool Verificerad { get; set; } = false;<br> public bool Admin { get; set; } = true;<br><br> public Admin(string forNamn, string efterNamn, string email, string password, DateTime fodd)<br> : base(forNamn, efterNamn, email, password, fodd)<br> {<br><br> }<br>}<br><br>public class Tur<br>{<br> public DateTime Datum { get; set; }<br> public bool Verificerad { get; set; } = false;<br> public string Beskrivning { get; set; }<br> public string Namn { get; set; }<br> public List<Guide> Guider { get; set; } = null;<br> public List<Kunde> Kunder { get; set; } = null;<br> public Restaurang Restaurang { get; set; }<br><br> public Tur(string Namn, DateTime Datum, string Beskrivning)<br> {<br> this.Beskrivning = Beskrivning;<br> this.Datum = Datum;<br> this.Namn = Namn;<br> }<br>} <br><br>I want the information to be sent to the app in JSON format. <br><br>This is where my problem turns into a question. <br><br>How do I make my main application (the C# application) send and receive JSON information to the app? <br><br>I know how to make the app and how to make a log in system in an app, but I have no idea how to send information from an app to the main application and vice versa.<br><br>So my question is, how do I make the app and main application send information to each other?<br><br>If anyone knows how I can do this, please help.<br><br>Thank you. <br><br>​<br><br>Edit: I changed "Application" to "App" in some places. <br><br>Hope it's more clear now. <br><br>​<br><br>Edit2: I changed "Application" to "Main Application" in some places. <br><br>Hope it's more clear now.
Comments (1) 1837 👁️