.net - Methods For Checking Business Rules?

Mar 20, 2012

I was having a discussion with a colleague about a method used to check business rules. In general there are two conditions:

"If one fails the whole thing fails"

Example 1: "If one fails the whole thing fails"I have used the following technique for condition 1 in several cases. Essentially if one of those conditions is false then the whole thing fails

Dim blnTemp As Boolean = True
If Fail=False Then blnTemp = blnTemp AndAlso False
{code code code}

[code]....

View 3 Replies


ADVERTISEMENT

Business Rule Engine - GUI To Check For Three Rules ?

Mar 30, 2011

I have a simple business rules engine that I need to write. I have looked at both Biztalk and Windows Workflow, but they are to much for what we need to do. This is a process that material will come to an operation, the GUI will check for three rules, one for the operation, one for the steps in the operation, and one for the item coming into the operation. These are the only three checks that will be done. It is possible there will be more than one rule for each check. I have a simple database set up to contain all the operations, steps and products and there is a crosstab table that links all the rules to each item. Here is an example of some rules (these are actual rules from the process):

View 5 Replies

Validate Business Object By Use Of Related Business Objects?

Oct 11, 2010

using an object-binding I have a an object representing "Employee". The employee has an ID-property. The ID of the employee must be unique.

My validation of the entered data is handled in the property set part of the object. In general, I validate criteria belonging to the object to validate only (eg numeric range of the ID, if it's value is not empy, ...). But in this case I need to know all ID's from the other employees. My tried this:

''' <summary>
''' Set EmployeeID
''' </summary>

[Code].....

View 2 Replies

Mvc - Repository Pattern Implements Methods By Adding Add1 But Should Use Methods Of The Baseclass?

Aug 29, 2011

This is the original code in c#

public class CategoryRepository: RepositoryBase<Category>, ICategoryRepository
{
public CategoryRepository(IDatabaseFactory databaseFactory)
: base(databaseFactory)

[Code]...

Does anyone has an idea what i should change to let it work and let my UserRepository use the methods in RepositoryBase while implementing the IUserRepository?

View 1 Replies

Cant See Available Methods List When Write Object.METHODS?

Jun 24, 2011

I am working with a vb program, but there is something strange on one of my .vb code pagewhen i put the "dot" afther the object name its dont show the methods availables for this objectbut on other vb code pages i can see it. but in this one no.for exmaplethis is a piece of code: Dim sb As New StringBuilder()

View 3 Replies

Making Class Methods Instead Of Instance Methods In .NET?

Mar 29, 2010

I am not sure how clear my question is by the title, but I am trying to make Class methods instead of Instance methods in Visual Basic that way I don't have to waste memory and code creating temporary objects to execute methods that don't need instance variables.

I am not sure if you can do that in VB but I know you can in Objective-C by using either a "+" or "-" sign in front of the method declaration. And in C++ (at least I think, I can't remember) you put the static keyword or const keyword in front of the function.How would I do this in VB if it is possible? Or should I just make a separate set of functions that are not members of a class?

View 2 Replies

Do You Follow All The Rules Of FXCop?

May 27, 2010

If we won't know what Exception will be thrown then why cannot we catch a general exception? I just cannot follow this and some more.

View 14 Replies

Making The Rules Of A Text Box?

Jan 15, 2012

So for the important part, right now I'm planning on creating a word detector somehow and there are specific rules I was to set in the textbox in relation with the button.Let's say I wanna set an IF Statement for the text to have 32 characters and letters "abcdefg" and numbers "12345" so that it'll execute a message box when I press the button.

Here's a code example of what I'm saying
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[code].....

View 5 Replies

DataGrid - How To Apply Validation Rules

Dec 20, 2011

Any way to apply some validation rules to the following code?
VB
Private Sub dgOperator_EditingControlShowing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewEditingControlShowingEventArgs) Handles dgOperator.EditingControlShowing
Const cSUBNAME As String = "dg_EditingControlShowing"
[Code] .....
Another thing should I be applying this validation on the Id Op'rateur column or when I click to the edit the next column in the datagrid i.e. Description?

View 5 Replies

Executing 'rules' In Visual Basic

Feb 16, 2012

I have created a system in Visual Basic 2010, which is to check on the existence of files attached in a access database. However there are different types of records in the database that will have to be checked against a different set of rules than others. For example one type of record will have to be checked to make sure certain named text files are there. However a different type of record will check for another text file with a different name e.t.c.

I have worked out that in order to do this I need a set of rules that the code in visual basic can match against and run that code depending on the choice. For example one type will execute rule 1,3,5 and the other type 2,4,6. I thought that these could be done in an XML document but am not too sure.

View 29 Replies

Store ASP.Net Access Rules On SQL Server?

Aug 8, 2011

So I know it's possible to store Users and Roles on SQL server but I was wondering if it was also possible to store the access rules on SQL Server. I've searched but I can't find anything.

Our auditor requires us to run reports that tell us which users have access to which websites. Currently I am parsing each web.config file to see which users/roles have access, storing that in SQL server and running a report off of that but I am hoping there is a better way.

View 1 Replies

Database Validation Rules And Masked Fields

Jul 16, 2009

i'm doing a project for school which requires me to make a fully functioning database program with validation. I'm done with almost everything except a few things and that includes the database, since i don't really know how to make validation rules and masked fields.It's possible i'm guessing to in forms and such but in datagrid view?

View 1 Replies

Rules/Guildlines For Closing Vs. Hiding Forms

Jul 16, 2009

I was wondering what Rules/Guildlines poeple for Closing vs. Hiding forms?

example:Should i only close a form when i am finished with it?

View 9 Replies

Task: Create And Display New Password Using Rules

Nov 24, 2011

Rules:

Rule 1: Replace all of the vowels (A, E, I, O or U) in the original password with a number as follows: (20 points) Replace the first vowel with the number of 1. Replace the second vowel with the number of 2. Replace all other vowels with the number of 9.

Rule 2: Replace all of the numbers in the original password with the letter Z. (15 points)

Rule 3: Reverse all of the characters in the original password. (10 points)

Rule 4: The enter password should be non case-sensitive. All the letters in new password should be in upper-case. (5 points)

This is what is should look like:

My code:

CODE:

Right now I'm not worried about the efficiency of the code (i.e. simplifying code into fewer lines). The problem I am having is the locating and replacing of the vowels. When running the program the code will replace all of the numbers with "Z", reverse the string, and make all letters uppercase. When it comes to locating the vowels, the program squares the number it goes through the string by the number of letters that it contains. I don't know why it does this.

when the string contains more then 1 vowel the first time it goes through it replaces all vowels with 1, then goes through again and replaces all vowels with 2, and goes through again repalcing all vowels with 9. These are all then combined into one string.

The research I have done has only turned up how to replace vowels with one thing (i.e. all vowels become "*")

View 1 Replies

COM ADD-in - Outlook - ItemSend - Check Some Rules Before Mail Is Send

Jan 24, 2011

I'm trying to write an Office 2007 COM Add-in which will check some rules before mail is send. Below test code works but I have several warnings in VS2010

[Code]...

View 1 Replies

Create A Form That Displays Rules Of Game On Label

May 10, 2011

I am having trouble with my code for Guess my number. I am definitely amatuer. Yes it is a homework assignment. No I am not asking you to do it for me. But I am stuck.Your GUI program is a game to be played by the user. See Screen Shot on Screen Shot Tab..A new employee is working on a classified mission and the program will randomly pick an expected profit to be guessed by the user.The program must randomly select an number within the range of 1 to 900.Do NOT use a 'Start Game' button to generate the rand number. Generate a rand number when the GUI is loaded.

1. Create a form that displays the rules of the game on a label.
2. Create a textbox for the user to input the guess and also a 'guess' button.
3. If the user is outside the given range, provide a proper message (<1 Is not a valid guess or >900 is not a valid guess)and clear the guess.
4. When a user has a valid guess, display a proper message (either too high or too low) and tell the user to guess again.
5. With a correct guess, display a proper message and change the form's background color to red and disable the guess textbox.
6. Create a reset button that allows the user to play the another game with a new random number.
7. Create a show me button that displays the number and does not generate another random number (allow the current game to continue).
8. Create a exit button to exit the program.
9. Ensure that you include error checking to prevent a user guess that is out of the given range and for any non-numeric characters.
10. Create a single Help menu item that launches a message box that displays valuable and meaningful information for the program and usage.
11. Create a label that tracks the guess count per game. Each time a new number is generated, start the guess count at 0.
12. Create a max guess limit set to 5 and use a progress bar to track the progress to approach the limit.
13. After each valid guess (1-900), clear the guess and update a label/textbox that displays all of the previous guesses up to 5 entries.

Here is my code so far. I have been working on one point at a time and then testing it. I have not even made it to numbers 11 - 13. I am not getting actual errors. Instead of my reset button clearing all fields at once I am having to click it more than once. Instead of displaying messages per scenario the message label is staying on either input a number or your number is too low. My Answer is not displaying when Show answer is clicked-perhaps my answer coding is wrong? [code]

View 14 Replies

EntLib Validation Syntax For Optional Field Rules?

Feb 25, 2010

I have an field, Address2, which is optional. Thus if it is null, no validation rules apply. However, if a value exists, its length cannot be greater that 255 characters.

I have been toying with:

<StringLengthValidator(0, RangeBoundaryType.Inclusive, 255, RangeBoundaryType.Inclusive, MessageTemplate:="Address 2 can be between 0 and 255 characters in length.", Ruleset:="MyRules")> _

But if it's not present, I still get an error.

View 2 Replies

Name An Event Handler Of A Private Variable In Following FxCop Rules?

Apr 22, 2010

On one side, in Vb.Net when you add an event handler to an object the created method is named: <NameOfTheObject>_<NameOfTheMethod>.As I like to have consistent syntax I always follow this rule when creating event handlers by hand.On the other side when I create private variables I prefix them with m_ as this is a common thing used by the community, in C# people use to put _ at the beginning of a variable but this is no CLS compliant.

View 1 Replies

Validate Controls Based On Rules Stored In A Table?

Jul 27, 2010

is there a way to validate controls on a form, where the validation rules themselves are stored in a database table?My problem is my application is used to submit forms to mulitple government agenices both local and state level. Every entity seems to have there own rules about what needs to be in what location. i would like to not have to code all of the various rules for all the different fields. My thought was to store them in a database table and then perform validation based on rule table lookups...however I would like to use the .NET validation controls.

View 2 Replies

Create A Set Of Grammar Rules For Speech Recognition Program With An Array

Jun 15, 2012

I have been trying to create a set of grammar rules for a speech recognition program with an array, but cannot seem to accomplish this task. Here is the general idea:[code]But this did not work, because I cannot convert strings into srgsoneof.

View 18 Replies

TimeZone Info Object Reporting Daylight Savings Rules

Feb 2, 2011

I need to write some code to tell the user when daylight savings starts and ends in another timezone, this is what I came up with but it keeps selecting the last Else line. The other lines are working fine, the problem is only with the lines, daylight savings today and not tomorrow. There is probably a much neater way of doing this but I thought this would work.

Private Sub Auto_Time_Change()
Dim sydneyTime As TimeZoneInfo = (TimeZoneInfo.FindSystemTimeZoneById("AUS Eastern Standard Time"))
If TSSlblTimeZone.Text = "Normal Time" Then
If CurDate.AddDays(1).Day = "1" Then
[Code] .....

View 4 Replies

VS 2005 - Boolean Checking - Better Performance By Checking For A True Value

Aug 4, 2010

Is there any better performance by checking for a true value like this:

[CODE]..............

Than like this:

[CODE]..............

View 5 Replies

Client Object Model: Uploading File To Drop Off Library Doesn't Apply Content Organizer Rules

Jun 29, 2011

I am currently developing a service using the SharePoint 2010 Client Object Model to programmatically upload Excel worksheets to a Drop Off Library and then set the properties on the file. This process is working well. However, the Drop Off Library is governed by Content Organizer Rules that aren't being applied to the uploaded file. I have examined every property I thought I could have missed: [code] What's most frustrating is that if I edit the document properties using the Web UI and check it back in without making any changes, the file is moved to its final location. What might I have overlooked that is preventing Content Organizer Rules from being applied to newly uploaded files when using SP2010 COM?

View 2 Replies

2 Different Methods Using Same Object Methods?

Aug 26, 2010

Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim someproc As Process

[Code]...

View 3 Replies

Way To Create A Business App?

Jun 27, 2010

I am attempting to create an application for my (very) small businessRight now I am trying to create an "Add a Customer" formI know VERY LITTLE about MySql so I thought I would save the text into a textfile.. I then realized I do not know how to save multiple text box in a text file (I only knew how to save one text box in a text file)

View 14 Replies

Which Is Better For Web Business Application

Sep 2, 2009

This is a debate that can never be fulfilled without you. Please come forward and respond.What if we have a client who wants to develop a web enterprise application (based on SAAS architecture) and prefers for C# and not VB.NET based. Argument can be:

1. C# is better suited for developing enterprise application versus VB.NET

2. C# is object oriented versus VB.NET is not

3. Programming in C# is faster than VB.NET

4. Libraries/function blocks in VS.NET is more for C# versus VB.NET

I would request you to help me answer this. I believe this is the type of questions many faces when deciding for which language to go for, both developers and organizations.

View 1 Replies

Business Layer Vs SQL Server

Jan 24, 2012

I have an application that does complex calculations for members. Each member can have multiple US states linked to their profile. Each state has got different calculations for each course a member completes. As of now I have been performing the calculations in the DB (SQL Server 2008) and then sending data back to app layer where they can see their history and then download a certificate for each course. I have a business logic layer but not a lot happens there. I know this has been asked a lot but where do you think I should perform these calculations: business layer or database? I am going back and forth

View 3 Replies

Create A Business Object?

Apr 19, 2009

Due to a discussion in another thread , I am starting to use business object in an 3-Tiered windows app. As a starting point, I am trying to build objects/classes on a table from my database.

The database table has the following columns:

ID
TypeID
Reference

[Code]....

View 1 Replies

GUI To Business Object Mapping .Net?

Jun 17, 2009

The issue I'm currently having is mapping multiple GUI fields to object properties (i.e. Presentation layer to Business Logic Layer mapping). To be more specific, this is in VB.Net 2.0 WinForms. The nature of the solution requires us to have 4 columns which exhibit the same type of behavior on our GUI - each column consisting of 11 textboxes (we'll just use this small sample size, as the problem extends beyond 11 textboxes).

What I am currently doing is setting the tag of each textbox in all four columns to a value like so:

Textbox1.tag = "name"
Textbox2.tag = "type"
Textbox3.tag = "speed"

[Code]...

As you can see this can get very bad, rather quickly. Currently we're setting 43 some odd properties that can be mapped to -- thus that select statement is extremely long -- many of which are embedded in multiple methods to try and attempt DRY (I've watered down the code to essentially a conceptual implementation).

Question is: how can I refactor this? I've attempted using a dictionaries/hashes to a certain extent, but it either became overly complex, or just plain didn't make an implementation sense as it convoluted the problem even more.

View 1 Replies

Big Business In Shirts, Especially For Groups And Teams?

May 20, 2011

does a big business in shirts, especially for groups and teams. They need a project that will calculate the price for individual orders, as well as a summary for all orders.The store employee will enter the orders in an order form that has text boxes for customer name and order number. To specify the shirts, use a text box for the quantity, radio buttons to select the size (small, medium, large, extra large, and XXL), and check boxes to specify a monogram and/or a pocket. Display the shirt price for the current order and the order total in labels.

Include buttons to add a shirt to an order, clear the current item, complete the order, and display the summary of all orders. Do not allow the summary to display if the current order is not complete. Also, disable the text boxes for customer name and order number after an order is started; enable them again when the user clicks on the button to begin a new order. Confirm the operation before clearing the current order.

When the user adds shirts to an order, validate the quantity, which must be greater than zero. If the entry does not pass the validation, do not perform any calculation but display a message box and allow the user to correct the value. Determine the price of the shirts from the radio buttons and check boxes for the monogram and pockets. Multiply the quantity by the price to determine the extended price, and add to the order total and summary total

The assignment also requires a pop up message "Daily Summary" with total shirts sold, total sales, and average sale per customer.So far I have this as my code but I am not sure what needs to change in order to display the correct total shirts- mine only displays the last accepted shirt order.

[Code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved