|
i create a large db and management system .
i will study this part
???
plz help me plz...
|
|
|
|
|
Without requirements, how do you know what you are delivering? You need to sort that before you even think about writing a single line of code.
|
|
|
|
|
behrouz shamlo wrote: how i to create a project of personnel input time and output time "File", "New Project". It's called a "timesheet", and it's one of the most implemented tools. There's even a starter-kit[^] that implements all functionality.
behrouz shamlo wrote: with connect to a fingerprint ? This is the reason why developers take specs, not managers. Does scanning the finger mean I'm starting work, or that I'm done working? And what if I'm in an accident? Is there a way to set my status to "absent" without the need for my finger? Would you allow a second interface, for when the scanner-device breaks, or would the client have to wait until there's a new fingerprintscanner delivered?
Without such an analysis, all that it is, is a "vague idea".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
my friends
plz insert a sample
tanks
|
|
|
|
|
I did, it was the link to the starter-kit. The rest still needs to be built. By you
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
i did not see your code....?
|
|
|
|
|
Follow the link in his post.
|
|
|
|
|
It's not "my" code, it's an example that Microsoft provides. Download the starter-kit and install it
|
|
|
|
|
visual studio 2010
I developed an asp.net application in which i used crystal report (for visual studio 2010). I have a big problem that is when i run my application on local server, it works fine but when i deploy it on remote server, crystal report is not displaying. can any one help me.
|
|
|
|
|
Hello everybody,
I do not what is happened, but I don't know how to do it.
I have a TreeView in the MainWindow and I use another Thread to fill it.
I use Dispacher.BeginInvoke command and the problem is that I obtain the exeption 'The calling thread cannot access this object because a different thread owns it.'
May somebody help me?
The code in the MainWindow Class --------------------------
Here, I call the Thread:
private List<string> gPS = new List<string>();
private List<PSItem> gPSItemsList = new List<PSItem>();
private void bt_PartsViewer_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog gOpenFileWindow = new Microsoft.Win32.OpenFileDialog();
gOpenFileWindow.DefaultExt = ".txt";
gOpenFileWindow.Filter = "Product Structure|*.txt";
Nullable<bool> gResult = gOpenFileWindow.ShowDialog();
if (gResult == true)
{
string gFilePath = gOpenFileWindow.FileName;
gPS = System.IO.File.ReadAllLines(gFilePath).Cast<string>().ToList();
pb_ProcessProgess.Value = 0;
Thread gTreeThread = new Thread(new ThreadStart(FillTreeView));
gTreeThread.SetApartmentState(ApartmentState.STA);
gTreeThread.Start();
}
}
The thread call to the method 'FillTreeView'. This method fills a list with TreeViewItems. The list is defined by the variable 'gPSItemsList' from a class (PSItem) inherited from TreeViewItem object.
I want to fill the TreeView with the index 0 of 'gPSItemsList':
private void FillTreeView()
{
. . .
LocateTreeItems();
tv_StructExplorer.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() =>
{
tv_StructExplorer.Items.Clear();
tv_StructExplorer.Items.Add(gPSItemsList[0]); (Here I obtain the exeption about different thread)
}));
}
The Exeption is not due to 'tv_StructExplorer' object but is for 'gPSItemsList[0]'.
I need help. Thank you.
|
|
|
|
|
You cannot touch a control from a different thread than the control was created on. The method to add these items to the control MUST be executed on the UI (startup) thread.
Don't get any funny ideas about creating the TreeView on the background thread. You also cannot touch the Controls collection of a form from anything other that the thread that created the form.
Basically, any and all access to anything you see on screen (forms, controls, insects that landed on your monitor) can only be touched by code running on the UI thread.
Personally, I'd drop explicitly creating Threads and move this code that reads, processes the file and returns a list of items to add to the tree to a Task that returns a List instead. You can then Await the Task and add the items immediately after the Await returns.
|
|
|
|
|
Thank you Dave,
I have understood your answer.
I will try to look for other way.
Sorry to reply you late.
Regards.
Boltian
|
|
|
|
|
No problem. Glad you understood it.
|
|
|
|
|
Olá amigos dos forum! eu tenho um método para calcular as textbox de um form caixa loja, até ai tudo bem! mais digamos que eu não preencha o campo desconto na compra de um cliente e precise calcular apenas os campos valorUnit * quantidade? como faço pra tratar o campo desconto, para não dá erro na hora de calcular?
o método que estou usando abaixa parece perfeito, mais quando eu clico no botão "calcula" ele não execulta nenhuma ação... Obrigado a todos por qualquer ajuda? segue o ex:
private bool Valida(params string[] valores)
{
return valores.Aggregate(true, (current, v) => current & TypeDescriptor.GetConverter(typeof(double)).IsValid(v));
}
private void calcula()
{
if (Valida(txtValorUnitario.Text, txtQuantidade.Text, txtValorPago.Text))
{
double valorUnitario, quantidade, desconto, valorPago, troco, total;
valorUnitario = Convert.ToDouble(txtValorUnitario.Text);
quantidade = Convert.ToDouble(txtQuantidade.Text);
valorPago = Convert.ToDouble(txtValorPago.Text);
double.TryParse(txtDesconto.Text, out desconto);
total = (valorUnitario * quantidade) - desconto;
troco = valorPago - total;
txtValorTotal.Text = String.Format("{0:C}", total);
txtTroco.Text = String.Format("{0:C}", troco);
txtTotal.Text = String.Format("{0:C}", total);
}
}
|
|
|
|
|
Que?
Could you translate that to English?
|
|
|
|
|
I'm not going to try and respond in Portugese: So you may want to find Translate.Google.com[^] to help you in future...
Why are you using two different methods to convert strings to doubles? Particularly when you are converting user input values from text boxes, you should always allow for input errors, and use double.TryParse as in your final example. However, when you use any of the TryParse methods, you must check the return value, or it is a waste of time. You have some error checking on the first three values, but why not check them with TryParse as well? At the moment if there is a problem with any of the first three fields, you do nothing - which is what you are complaining about...
Try this:
private void calcula()
{
double valorUnitario, quantidade, desconto, valorPago, troco, total;
if (!double.TryParse(txtValorUnitario.Text, out valorUnitario))
{
... Report problem to user
return;
}
if (!double.TryParse(txtQuantidade.Text, out quantidade))
{
... Report problem to user
return;
}
if (!double.TryParse(txtValorPago.Text, out valorPago))
{
... Report problem to user
return;
}
if (!double.TryParse(txtDesconto.Text, out desconto))
{
... Report problem to user
return;
}
total = (valorUnitario * quantidade) - desconto;
troco = valorPago - total;
txtValorTotal.Text = String.Format("{0:C}", total);
txtTroco.Text = String.Format("{0:C", troco);
txtTotal.Text = String.Format("{0:C", total);
}
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
Hello, OriginalGriff thanks for replying! I used your code, I added
some more things and looked like this:
<pre lang="cs">private void calcula()
{
double valorUnitario, quantidade, desconto, valorPago, troco, total;
if (double.TryParse(txtValorUnitario.Text, out valorUnitario))
valorUnitario = Convert.ToDouble(txtValorUnitario.Text);
else
valorUnitario = 0;
if (double.TryParse(txtQuantidade.Text, out quantidade))
quantidade = Convert.ToDouble(txtQuantidade.Text);
else
quantidade = 0;
if (double.TryParse(txtValorPago.Text, out valorPago))
valorPago = Convert.ToDouble(txtValorPago.Text);
else
valorPago = 0;
if (double.TryParse(txtDesconto.Text, out desconto))
desconto = Convert.ToDouble(txtDesconto.Text);
else
desconto = 0;
total = (valorUnitario * quantidade) - desconto;
troco = valorPago - total;
txtValorTotal.Text = String.Format("{0:C}", total);
txtTroco.Text = String.Format("{0:C}", troco);
txtTotal.Text = String.Format("{0:C}", total);</pre>
|
|
|
|
|
You don't have to do that: TryParse attempts to do the conversion, and if if succeeds, it returns the value in the out parameter, and true as the result. If it fails, it returns false, and deosn't touch the parameter.
Normally, you would want to report a problem when the user enters a bad value (otherwise he will assume it is correct and using his values):
if (!double.TryParse(txtValorUnitario.Text, out valorUnitario))
{
MessageBox.Show("Please enter a number!");
return;
} But if you don't you still don't need to convert the value once you have checked:
double valorUnitario = 0;
double.TryParse(txtValorUnitario.Text, out valorUnitario); And ignore the returned result. You will get 0 if the textbox is bad, or the value if it is good.
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
eu sou novo em c#, mais entendo que na primeira linha que vc colocou ai
ele faz uma espece de validação, é isso? se o valorUnitário não for um número válido
ou estiver vazio, ele manda inserir outro número?
|
|
|
|
|
If txtValorUnitario.Text does not hold a valid double, then the value in valorUnitario is set to zero and false is returned. (See MSDN: double.TryParse[^])
(I was wrong, I forgot it's an out parameter, so the value won't be preserved if the conversion fails - it will be zeroed.)
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
Beleza esse exemplo que vc me mandou! deu para entender direitinho!
consegui resolver aqui com sua ajuda, depois eu posto o código...está
no outro computador em casa! mais valeu meu caro, muito obrigado...
|
|
|
|
|
Você é bem-vindo!
(And I hope Google Translate isn't being rude, here... )
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
Sorry if this is not the right place to ask about this.
I want to program a digital pet in Linux (it will run in a Raspberry Pi) but there is a long time I don't use C++. In fact I love C# and I am familiar with XNA.
For that reason I am thinking about monodevelop. The problem is that I need to manage microphone input (if possible voice recongnition), webcam input and maybe I will add some sensors like inclination.
Stuff like collision detection is not needed.
Is monodevelop suitable for doing this? Do you recommend C++ better? Thank you.
|
|
|
|
|
Mono is fairly decent these days however that doesn't mean it will lead to success for your goals.
You would need to be fairly comfortable in linux. I suspect strongly that you might need to know interop and you might need to do some C++ programming regardless.
|
|
|
|
|
eleazaro wrote: For that reason I am thinking about monodevelop. I've got Mono running on my Pi, including ASP.NET and MySQL. Works quite good. There's also a GPIO library[^] to control the general purpose port on the Pi. That's probably where you'd want to hook up the sensors. Although it runs Mono fine (4.0 compatible), I wouldn't recommend installing MonoDevelop and running a desktop on the system. It's easier to prototype on Windows using .NET and to copy the result (using FTP) to the Pi.
eleazaro wrote: The problem is that I need to manage microphone input (if possible voice recongnition), webcam input
Not all webcams[^] are supported. Didn't test mine yet. However, I doubt that it's fast enough to provide voice recognition.
eleazaro wrote: Do you recommend C++ better?
I'd recommend looking for a "robot project" as an example, as it has most of the components you said you'd require. Looks like example number four[^] proves that the Pi is capable of process voice-commands.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|