|
I wanted to mention that the program I talking about is executed from 2 other programs. Thus does it make sense to make part of this called program a dll?
|
|
|
|
|
|
I agree with Piebald, restructuring for it's own sake is a waste of time, if you don't have a reason to make the change then don't bother.
Having said that I always structure an application, I imagine any developer quickly comes to this decision, I would keep the UI elements in the exe, the business logic in another and the data access in a third but this is just for my convenience and to make support easier.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Is this the same contract shop that gave you a console app to control the web service? If it is, any advice from them should be ignored as they are clueless morons who should be kept away from electronic equipment.
|
|
|
|
|
how can I be a professional in C#.Net framework ?
what should I do?
|
|
|
|
|
Study, study, study and practice, practice, practice.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
As Richard said, practice and study. No one can become a professional at something without practicing and studying. You might want to read up on .NET Book Zero[^]
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Paul Conrad wrote: .NET Book Zero The first book I read when trying to understand C# and .NET.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hello guys,
I am doing a C# application + SQL Server DB to manage employees, contracts, rate of work, contract durations, hourly rates... and do some funny calculations with that.
Basically, I need to store some values with the format "0000,0000" in my DB
I have actually build my app interface with winforms and i didn't have any problem to insert, select, update to my SQL Server DB, until I started to play with the numeric/double/float values
- I have set my table with all columns where i require these "000,0000" values to decimal
- In my forms, i haven't specified any specific properties to my textboxes,
- To insert I use a method for which i defined decimal arguments
public void createNewContract(int employeeId, string agency, string role, string contractType, string startDate,
string endDate, string lineManager, string reportTo, string costCenter, string functionEng, string atrNo, string atrDate, string prNo, string prDate,
string poNo, string poDate, string comments, decimal duration, decimal workRatePercent, string currency, decimal hourlyRate, decimal value)
- To capture my textbox values and send them through my method 'createNewContrat', I have tried
Convert.ToDecimal(this.txtDuration.Text)
and plenty other things that seemed good to me, but i don't manage to understand the mechanic and i'm certainly not using the most pratical/clever solution...
What would you recommend?
Thank you for your help
Brice
|
|
|
|
|
I prefer a NumericUpDown for numeric values. TextBoxes are for text.
|
|
|
|
|
Any particular reason your createNewContract takes on 22 parameters? That is an eye sore. Why not have a class that holds the parameters and pass an instance of the class object as a parameter to improve readability.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Thank you Paul,
I think you are driving me on a direction I wasn't thinking of
How would you do this (on a sample section of code)?
In general, what are the advantages of your solution compared to what I'm doing? Reuse/visibility?
The concept is new to me
Thank you
|
|
|
|
|
Yes, my post was not really directed to your actual question but an off topic observation I made. How to do my suggestion is pretty straightforward. Just have a class with properties that are the parameters (this is where you could check for invalid parameters as well - unless you have checks done elsewhere), and you populate the properties with the respective values and just pass the object.
The advantage is clarity and readability, and it doesn't hurt to have all the values you are passing to be encapsulated in a wrapper class. Either the way you have done it, or my suggestion, both work.
Back to your original post, I would second PIEBald's suggestion if it works for you.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Something perhaps along the lines of:
public class Contract
{
int employeeId;
string agency, role, contractType, startDate, endDate, lineManager, reportTo;
string costCenter, functionEng, atrNo, atrDate, prNo, prDate, poNo, poDate;
string comments;
decimal duration, workRatePercent;
string currency;
decimal hourlyRate, value;
public Contract()
{
}
public int EmployeeId
{
get
{
return employeeId;
}
set
{
employeeId = value;
}
}
public static void createNewContract()
{
}
}
Inside the properties for anything that works with decimals, you can take care of the conversion there. Again, this is just a slight off topic suggestion, and I do not know how much work it would be to put this into your application, but it's a kind thought
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
It all really make sense to me now
I'm going to pursue this way
Thanks a lot!
|
|
|
|
|
You're very welcome. At first, it sounds like it is a bit of extra coding, but it is worth it in the long run!
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
how to creat theme with c#?
|
|
|
|
|
Theme for what??
The quality of the answer you get is directly dictated by the quality of your question. If there are critical details you leave out of your question, people will only be guessing at what you really mean.
Is this for generating a theme for another application or for Windows or are you talking about skinning your own Windows Forms app, or your WPF app, or an ASP.NET app, or ... what??
BE SPECIFIC!
|
|
|
|
|
theme for skining on my own windows form
|
|
|
|
|
Try this:
System.Console.Beep ( 349 , 245 ) ;
System.Console.Beep ( 329 , 245 ) ;
System.Console.Beep ( 622 , 245 ) ;
System.Console.Beep ( 587 , 983 ) ;
System.Console.Beep ( 493 , 245 ) ;
System.Console.Beep ( 440 , 245 ) ;
System.Console.Beep ( 493 , 983 ) ;
|
|
|
|
|
Hi! i have a code written in c#, this code is of a server that receives GPRMC frames from the client and it determines the location of the client! what should i do to modify the code and the frame so it will contain a signal of emergency sent by the client?
|
|
|
|
|
Don't repost the same question again. Have some patience.
People will answer your question IF they have any clue what you're talking about and have anything useful to say.
Truthfully, we have no idea what you're doing nor does anyone have any clue why you want to modify the GPS data. To what end??
|
|
|
|
|
i want to change the program, so if the client feels in danger, he will send signs to the server telling him that he is in danger! I want to modify the GPRMC frame so it will send an emergency sign with its other informations
|
|
|
|
|
I take it you're writing both the server and the client software??
If so, then you just need to wrap the GPS data in a message with an appropriate flag telling the server it's an emergency. The server will have to be reworked to expect this message instead of just a line of GPS data, or whatever you've got the server listening for.
If you're not writing the software for both sides of this app then you've got a seriously large problem as it's extremely unlike you've going to get a manufacturer to modify anything to your specifications.
|
|
|
|
|