C# - Changing Program Logic To Accommodate New Retail Tax Law?
Jul 23, 2010
Background: I have a program that has implemented the two "classic" taxes for Ontario Canada: 5% GST and 8% PST. At the beginning of July (2010) the province switched to one combined HST tax of 13% for the most part. Effects and changes here but those aren't the main point of this question...
Question: What are best practices and good solutions to accommodate for future changes easily in retail taxes? Tax changes occur often enough. I'm sure there are a many SO users with good experience.
View 2 Replies
ADVERTISEMENT
Jul 22, 2009
I'd like for debugging purposes to be able to log what functions are called and in what order. So I've been just putting Debug.WriteLine("myFunctionName(args)") all over my functions, logging it in the end to a file. Isn't there a better approach to do this?
View 4 Replies
Oct 11, 2009
I have setup an application to parse about 3000 files a day where each contains around 4000-5000 posts in xml format with like 100 fields.It involves a lot of cleanup and parsing but on average it takes around 6 seconds per post.Now I tried threading but because of the way I have everything set up with variables being overwritten etc...I have divided the files into different folders and just created copies of the program to run and access the assigned folder. It is running on a windows 2008 server with 16 G of memory and I am told I need to reprogram to speed up the process and also not use so much memory.
For i As Integer = 0 To fileLists.Count - 1
Do
Try
[code].....
View 2 Replies
Nov 22, 2010
I have an application that I need to automate where at a certain time each day, say 6pm, it will run a certain method(which is to check a database for key terms and then access the api to search for these terms). But there is the main process which is running all the time accessing the stream api so when the search is complete, it interrupts the stream and hands over the new terms. Now I thought of adding the .exe file to windows task scheduler but not sure if that would work. The stream method runs indefinitely and at 6pm each day another process needs to run. I thought of using the system.threading.task TaskFactory but I am using visual studio 2008 ( I do have .net framework 4.0)If it launches using the task scheduler as 6pm with my code logic as follows:[code]
I see how this would eat the CPU...the streaming process is basically following a list of user profiles listening for new activites and storing these as XML files. This a real time feed to an API. At a specific time once a day, a second process needs to go access a database for new ids, and if there are new ids, then go to a search API and get new user profiles. This is the main criteria..once the new user profiles are found, the list that the stream users needs to be updated so the process will be interrupted for a second or just paused and then continue processing.
View 10 Replies
Mar 29, 2011
I have setup an application to parse about 3000 files a day where each contains around 4000-5000 posts in xml format with like 100 fields. It involves a lot of cleanup and parsing but on average it takes around 6 seconds per post. Now I tried threading but because of the way I have everything set up with variables being overwritten etc...I have divided the files into different folders and just created copies of the program to run and access the assigned folder. It is running on a windows 2008 server with 16 G of memory and I am told I need to reprogram to speed up the process and also not use so much memory.
[Code]...
View 3 Replies
Aug 13, 2009
I have a pretty complicated project with lots of class files, code modules, etc. There was a changed to one of my referenced DLLs that requires an isolated change in a single Sub within my solution. Unfortunately, this new Sub is not compatible with most of my clients' configuration but is required by some of my other clients. So now I must keep two versions in Source Safe of my solution - which I do not want to do. What I would like to do is to be able to determine which DLL is running and flip a switch to use the either the old Sub or the new Sub. Currently the sub is in a class, but I could break it out. Is it possible to determine which assembly version DLL is running? Also, if I reference the new DLL, the old Sub will not build. If I reference the old DLL, the new Sub will not build. So is there a way to keep both Subs in the same project?
Can I use reflection to know what is the assembly version of a loaded DLL?
View 3 Replies
Aug 25, 2009
how to accommodate two datagrids from two different tables on same form as only one binding navigator bar is shown on the top of the form.
View 4 Replies
Nov 30, 2010
I am attempting to code a VB project for one of my classes. The assignment is to write a program that take the input of Wholesale cost and markup percent, then calculates retail price. When I finished the code, any input I use results in the retail price showing as $0.00.
Public Class Form1
'Declares a variable to hold the wholesale value
Function wholesaleIsValid() As Boolean
Dim dblTempValue As Double
[code].....
View 2 Replies
Mar 24, 2009
I have about 80% of this app done. All I need to do is convert what the user inputs of the wholesale cost of the item (lblCost and txtCost) and and convert that and the retail price to its markup %(lblMark and txtMark)
View 10 Replies
Aug 13, 2009
I have a pretty complicated project with lots of class files, code modules, etc. There was a changed to one of my referenced DLLs that requires an isolated change in a single Sub within my solution. Unfortunately, this new Sub is not compatible with most of my clients' configuration but is required by some of my other clients. So now I must keep two versions in Source Safe of my solution - which I do not want to do. What I would like to do is to be able to determine which DLL is running and flip a switch to use the either the old Sub or the new Sub. Currently the sub is in a class, but I could break it out. Is it possible to determine which assembly version DLL is running? Also, if I reference the new DLL, the old Sub will not build. If I reference the old DLL, the new Sub will not build. So is there a way to keep both Subs in the same project?
View 1 Replies
Sep 3, 2010
The application uses ADO.NET to invoke sprocs for nearly every database operation. Some of these sprocs also contain a fair amount of domain logic. The data access logic for each domain entity resides in the domain class itself. ie, there is no decoupling between domain logic and data access logic. I'm looking to accomplish the following:
[Code]...
View 2 Replies
Aug 31, 2009
I am trying to build a retail store application that uses a barcode reader. I need to know how to get the barcode data in my application and use it against my items database.
View 2 Replies
Dec 4, 2008
I am writing a VB 2008 program to display and update records from a sql database. This particular form is used to display and modify retail store information records from the database. I am running into an issue with saving the records once they have been changed.The error message I am getting is "Update requires a valid update command when passed DataRow collection with modified rows". I am including all of my code for the form because I am not sure what is relevant. I am getting the error when SaveTheEdit() is called on line 83. [code]
View 2 Replies
Aug 20, 2009
After using a form as a replacement for MessageBox I do have a need to make it automatically adjust its size to fit its contents, is there any rule out there that we need to abide to when it comes to sizing the form acting as MessageBox?
I am thinking I could use a panel that will auto-resize and just resize the form according to the size of the panel but I am not sure that will work as I haven't tried it yet.
View 4 Replies
Sep 3, 2011
So, I want to know. What are the possibilities of changing the FPS of a given program. If the odds are anything about 0,
edit: I didn't make myself very clear. I'm just curious if it's possible change a program's limit to FPS. For example, I can change Firefox.exe to only get 10 FPS, and nothing more.
View 6 Replies
Dec 12, 2009
i was wondering if it is possible to changed the background of the actual computer desktop. i've searched, but all i can find is how to change the background of the form.
View 1 Replies
Jan 20, 2009
This is maybe an weird question because I don't know if its possible so prepare .I am working on a project its a kinda autoclicker.It moves the cursor to positions and perform mouseclicks it all works perfectly.So when it runs you can't do something else on the pc because the cursor gets moved every 1-5 seconds.So I wanna now if its possible to kinda attach it to the program I am making it for so it moves the cursor and do clicks within the form of the program.
View 1 Replies
Apr 9, 2009
I am writing a program, and it worked just fine, then I changed the icon on the program and I get an error when I try to run the program. Attached is the window that I get when I debug the program.
View 3 Replies
Oct 3, 2009
I have textboxes and lables (e.g. displaying changing filenames etc) which I hope to display the latest value when a program run.But the fact is, I found content of such textboxes and lables are not updated when the program run (under debug mode) although I'm sure that I've issue such command as textbox.text="xxx" or label.text="yyy" etc.What should I do in order that the textbox and lable can always display latest value when a program run?
View 5 Replies
Jan 31, 2009
I recently started out using Visual Basic, and I've run into a problem.I need to be able to change between my two forms when I run my program, however since I'm still rather new at this, I've been unable to figure out a way to do this.
View 8 Replies
Jan 12, 2009
make a password changing program?
View 3 Replies
Mar 21, 2012
I've added a setup and deployment package to my project. When I go to install it the first screen says "Welcome to the setup setup wizard." Obviously, that doesn't look right. I want to change this, but can't figure out where that setting is. How to rename that setting so that it says "Welcome to the Wonderful Program setup wizard" instead?
View 6 Replies
Sep 21, 2010
I'm searching for a way to change the font size of selected text in a RichTextBox (rtf) having different font families (e.g. Arial and MS SansSerif) and font styles (underline, bold...) using the FontDialog, but without changing the families and styles. The following code resets all the font attributes, which is not what I want:
[Code]...
View 5 Replies
Jan 19, 2012
In many of the articles I have read on the web say that when creating properties in vb.netthey should use the get/set methods and a private/protected member variable in the class.
Like so:
Public Class Person
Private _name as string
[code].....
View 3 Replies
May 1, 2009
in my page Having 4 Buttons ..(FIRST,PREVIOUS,NEXT,LAST) ..i am confusing to this one..
Actually what i am doing is Iam developing one efrom Designer in this user is adding pages..
so We have given These Buttons (before told)..so user click on First Button page goto Starting page and When click on Next Button Goto Next page ..like this
View 5 Replies
Oct 15, 2010
I have 3 tables:Sales data - SaleID, Date, StoreID, CategoryID, Cost, Retail
Store names - StoreID, Name
Category names - CategoryID, Name
I have a dgv bound to my sales table, and 2 comboboxes, one each bound to the remaining tables, with display member set to the name, and value member to the ID.
An ID of -1 represents "All Stores" or "All Categories"
An ID > -1 represents a specific location or category
So, can I use some sort of If,Then,Else logic to do something like this:
SELECT (*) FROM Sales
WHERE (IF @StoreID > -1 THEN StoreID = @StoreID ELSE True)
AND (IF @CategoryID > -1 THEN CategoryID = @CategoryID ELSE True)
AND Date BETWEEN @Date1 AND @Date2
I've found some different examples of If/Then/Else and Select Case type logic for SQL using google, but they don't seem to fit my situation, and I'm not sure how to apply that to what I'm attempting here.
View 2 Replies
Mar 4, 2012
I've got a problem when I'm trying to refresh my form. I've narrowed it down to why I'm getting this error so I'd be interested to hear people's opinions because logically, I don't think I'm approaching this the correct way.
I read from a table that gets x number of records. From the results, I create dynamic check boxes. It's OK if x is greater than the previous refresh but when it's less than, I can still see the old objects.
If I completely close the form and re-open it, it works fine and that is exactly what I'm trying to emulate. However, I'm failing miserably. Here's a broken down version[code]...
View 5 Replies
Oct 14, 2009
I have a datafield [Money] of datatype float.when i input currency value with $,or , it throws an error.How do I allow $ or "," to this field without changing the datatype(I know changing to type money may fix it)
View 3 Replies
Feb 28, 2011
While building an xml document I require to use logic to dictate the outcome of the xml; logically it is similar to the following piece of code (although this does not work):
Dim buildElement As Boolean = True
Dim xe As XElement = _
<xml>
[code]....
I have managed to do this using the method show below, is this the suggested way of doing this or is there a better one??
Dim buildElement As Boolean = True
Dim xe As XElement = _
<xml>
[code]....
View 1 Replies
May 2, 2010
How can i write logic to check is it my sql statement being insert into my database ? is there any ways to create or thing can check thru by using webservice?
View 13 Replies