|
Roger Wright wrote: frigid winds
Yes.
|
|
|
|
|
Hi there !
I start to developing a hotel managment system C# + MySQL database.
I have to make some like graph schedule (it's only for view)
It should looks like:
for example on some month...
is 3 persons in room2 from 2 to sixth day of month and the color of this line...
1 2 3 4 5 6 7.... 31 (days for months)
room1
room2 3 3 3 3 3
room3
it will download the data_from and data_to of reservation some of specified room, the type of residence which is declarated in specified color and then at last how many persons are in this room
and now it will draw lines of a given color from the day-to-date and in the middle of this line in each row of the color line the number of people in this room
I wonder how to do it ... First what control should i use dg, lvor ..?
And how to declare this all months with days...
Plz help how to start it?
|
|
|
|
|
I'd use a DataGrid and to keep it simple stupid have a class that represents the room and every day of the month. Then write some code which returns a collection of the class. There would be a lot smarter ways to approach this but sometimes keeping it simple is the most maintainable.
You may also look at your database structure because sometime guests may stay in one room for 2 nights and a luxury room for 1 night. You may want to store this data night by night and not from-to date.
Good luck with it. Micros Fidelio are one of the most fierce competitors your every likely to bump into.
Architecture is extensible, code is minimal.
|
|
|
|
|
i will have a data_from, data_to in, number_of_people register table the colors will declare in other one i think and the room in other and buildings in other :/
In C# i will have .cs files which represents entities and mapping classes for this entities .
But could u write some example how it could be? I Will really happy I heard somewhere that lv will be better than dg...
BTW if I will use Flunet NHibernate and LINQ NH + mapping should I make in My MySQL Server relations on Entities (i mean in MySQL Server) or just make entities and PK's but in VS Entities .cs files and mapping it will be enough ?:
for example:
public class ClientMap : ClassMap<Client>
{
public ClientMap()
{
Id(x => x.Id).Column("client_id");
Map(x => x.FirstName).Column("imie");
Map(x => x.LastName).Column("nazwisko");
Map(x => x.Created).Column("utworzony").Not.Nullable();
Map(x => x.Updated).Column("aktualizacja");
Map(x => x.Deleted).Column("Usuniety");
HasMany(x => x.Rooms)
.Access.Property()
.Cascade.All()
.LazyLoad()
.KeyColumn("client_id");
Table("klient");
}}
modified on Tuesday, February 1, 2011 6:45 PM
|
|
|
|
|
I don't have any examples at hand but there are a few open source PMS systems out there so do a search and see how they have approached the problem. It's a fundamental requirement for both PMS and CRS systems.
Regards
Rob
Architecture is extensible, code is minimal.
|
|
|
|
|
in my application once a client connected i run the following code
byte[] buffer = new byte[512];
while (soc.Connected)
{
try
{
soc.Receive(buffer);
string encodedstr = Encoding.UTF8.GetString(buffer);
this.Invoke(update, new object[] { encodedstr });
buffer.Initialize();
}
catch (Exception)
{
if ((soc != null) && (soc.Connected))
{
soc.Disconnect(false);
}
}
}
but when the client disconnected by closing or accidentally the server runs infinite loop with the
last content sent by the client. so my textbox infinitely append the last data to it's content.
so i want to know if ther is any other better way of receiving data from client continuously to solve this problem.
|
|
|
|
|
That is how TCP/IP works.
The only sure way to validate if someone is on the other end is by sending something, sometimes quite a bit of something.
The way servers commonly solve the problem is that they require clients to send them data during a given time period. If the client fails to send anything then the server disconnects.
Another way is to explicitly send a do nothing message to which the other end must respond within a given time period. If they don't respond then disconnect (obviously disconnect as well if there is a delivery failure.)
|
|
|
|
|
None of the information in your post is correct as far as using a socket class is concerned and applies only to writing your own TCP/IP stack.
|
|
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: See Page 45[^]
I suggest that you make it more explicit how you think I am wrong.
Or perhaps you could provide a code sample of a listening socket that will detect that the other end is gone when the power plug is pulled on it.
|
|
|
|
|
I suggest you read the documentation for Windows Sockets and the RFC and use them as guides instead of Google searches yielding results that are questions and answers from non-definitive sources. When you post an answer as an Authority you have some responsibility for accuracy. Using TCP/IP and then manually sending keep alive messages is a waste of the protocol.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: I suggest you read the documentation for Windows Sockets and the RFC and use them as guides instead of Google searches yielding results that are questions and answers from non-definitive sources. When you post an answer as an Authority you have some responsibility for accuracy.
You are incorrect in the intent of my posting.
I know how sockets work having worked with them in C#, Java and C++.
I was citing references to back up what I was saying rather than just restating what I said already - which is what you are doing. Feel free to provide some specific references to make your point. Or cite something specific from the RFC.
I have in fact read the RFC and the C# documentation.
Again...please provide a specific comment on exactly how you think all or part of my response was incorrect.
Ennis Ray Lynch, Jr. wrote: Using TCP/IP and then manually sending keep alive messages is a waste of the protocol.
This statement indicates that you do not know how TCP/IP works.
Again feel free to provide code and a specific scenario that allows a listener to detect when the other end is terminated by a pulled plug. Feel free to provide the code in C#, C++, Java or even Perl.
Although I suppose it is possible that you did not understand why I was suggesting a keep alive. Perhaps that is where your confusion lies.
|
|
|
|
|
prasadbuddhika wrote: while (soc.Connected)
I doubt that is going to serve the purpose that you think it is.
That doesn't validate the connection. All it tells you is that at some time in the past that it worked.
The following are probably the general run time conditions that one faces with sockets.
1. It fails to connect at all. Reasons: Wrong address, port, firewall rules or the server is down.
2. It runs
3. The server disconnects gracefully. Receive() will return zero.
4. The server takes too long. Reason: Server is locked up.
5. The server never responds. Reasons: Someone kicked out the power plug or the firewall dropped the connection.
Notice that in 4/5 no exception occurs. You can get an exception to occur by setting a time out value. That tells you that it hasn't sent data but not why.
|
|
|
|
|
Hi all
how to do function like Console.write() but without using Console.write() and with different name.
I want to say how to create a print function without using Console.write() and name it as you like.
I hear that i can do it by overloading or overriding or anything else .. i don't know.
Thank's
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
modified on Tuesday, February 1, 2011 11:50 AM
|
|
|
|
|
So, you want to write a new method that does exactly the same as the old method. Is that what you're saying?
You could always open up the Console class in Reflector and see what Write (and WriteLine) is doing, and use that as the basis of your code.
|
|
|
|
|
Thank's for reply
but i want to say how to make new method like Console.write by overloading without using Console.write.
-*-*-*-*-*-*-*-*-*
To Be Or Not To Be
(KARFER)
-*-*-*-*-*-*-*-*-*
|
|
|
|
|
I already told you how to do it. Open Console.Write up and have a look at how it does it.
|
|
|
|
|
Don't repeat your question. Remove the one above before some replies to it
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
are you wanting to output to the console?
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
|
|
|
|
|
KARFER wrote: I want to say how to create a print function without using Console.write() and name it as you like.
In what language would you want that, C, C# or C++?
KARFER wrote: I hear that i can do it by overloading or overriding or anything else .. i don't know.
Well, you can create methods and name 'em however you want, and they can do whatever you want. Problem is often describing what one wants. Try giving a more detailed example on what you're trying to accomplish
I are Troll
|
|
|
|
|
Eddy Vluggen wrote: In what language would you want that, C, C# or C++?
I feel obliged to draw your attention to the Forum name, Eddy...
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Marcus Kramer wrote: I feel obliged to draw your attention to the Forum name, Eddy
This isn't my forum, it's the C# forum
He's cross-posting, making me wonder what kind of textbook he's reading to come up with a question like this
|
|
|
|
|
We can only wish he would start studying a book rather than ask random questions.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Eddy Vluggen wrote: In what language would you want that, C, C# or C++?
You forgot Visual Basic and PHP.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.
|
|
|
|