Hi My name is Teame.
I want to develop a cafeteria management system using C#. But, I want to compose the consumption and to reduce from master inputs balance. For example, when I want to make an output called pizza, I have to use a potato, tomato, oil, green paper, and so on inputs. Then the inputs I have used should be reduced from the master inputs balance and will made as an output product called Pizza. So, please, help me to how to reduce the input consumption automatically when the waiter orders a Pizza using C#. I would like to say thank you for your support.
The obvious answer would be to use a database. You would need to keep a table of ingredients in the database which includes counts of current stock. Then as you create a food item you get the count values from the database, reduce them by the amount used and update the counts. There are many database tutorials to be found.
Dear Richard MacCutchan,
I would like to say thank you for your response. But, I need some example that how to reduce and count if you have any link for the database tutorials which matches the question I am asking. Thank you Very much.
I am using Microsoft SQL Server to create the database for the cafeteria management system. If you have a link which will help me to refer and to get some tutorial, please, give me the link. Thank you for your help.
When I add a ADO.Net Data Entity Model, and let it create entities (from stored procs if that matters), it adds "_Result" to the end of the entity names.
How can I keep it from doing that?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
This is from memory, you might need to dig around or google for the specifics, when when you configure an SP in EF you can have it create a type for the results (which is what you're seeing with _Result), or you can define your own class, call it what you want, and tell EF to use that class instead. How you do this will be in the properties for the SP in the model diagram if you look.
I have to call my customer's soap web service through my desktop application.
For testing purpose, I created an exactly same soap web service with same asmx file name and methods with same input parameters and same return types.
my application works fine with my test web service. but when i change the web service URL to customer's URL it gives me error 502 Bad gateway.
When I create a new web service reference with the customer url and change all references in the source code, it works fine. but practically I can do this with test application but i can not do this with our live production application.
How can I make my application to work 2 similar soap web services at 2 different URLs without getting the web reference and and recompile the application.
You should grab the WSDL from actual serivce URL by appending ?wsdl to it. Add that as a reference to your application code. By doing this, you get accurate service definition and a URL in app.config in your application.
You can then generate a mock service using SOAP UI or any other tool of your choice and update the app.config URL to point to mock service.
Can someone help me please. I'm building a structure for a C# program.
When I run this program I get the error "Program does not contain a static 'Main' method suitable for an entry point".
If I add a static to the Main [pubic static void Main(stringp[ args)] then I get errors for all the calling names such as ReadHeader; ReadVerbs; etc
What do I need to change?
public class Program
public void Main(string args)
public void ReadHeader()
public void ReadVerbs()
public void ReadNouns()
public void ReadObjects()
public void ReadStartRoom()
public void ReadRooms()
public void ReadMessages()
public void ReadAutoActions()
public void ReadActions()
You create an instance method: which means that it needs an instance of it's containing class in order to be used.
Think about cars for a moment: what colour is your car? What colour is my car? What colour is that car - that one, over there, next to the lamppost with the cat sitting on the roof?
Those are all questions you can ask, because you are specifying which car you are referring to: Your car is green, my car is black, that car - that one, over there, next to the lamppost with the cat sitting on the roof is red. It is an Instance Question - it requires an instance of a car to be specified in order to be asked.
You can't ask "what colour is a car?" (or more accurately you can't answer that) because not all cars are the same colour.
But you can ask "how many wheels has a car?" because all cars have four wheels (if it had 2 it would be a motorbike, and three would be a trike). "How many wheels?" is a static question, because you do not need an instance of a car to ask it.
Classes and methods are the same: Instance methods need an instance in order to be used, static methods don't.
And the Main method is where your code starts executing, so it can't have an instance as nothing exists to create an instance (and of what?) before Main is called.
And that is what the error is saying: "There is no static Main method I can call to start the code running".
Add the static keyword to your Main method declaration, and the error will go away: