Archive for July, 2007

Multipurpose of Exception Handling Class Part 3

Hi..see you again.. this section is the continue part of my trilogy Multipurpose of Exception Handling class, okay let’s make it this quickly, the last class that we need is EmailGenerator class :

  • This class using 3 core of .Net library; System IO for accessing the XML email template,System XML and then System.Web.Email.
  • The main idea for this class is service another class that want to generate the email notification so we need to produce the public method for sending the emai, here are the method

public void AutomaticSendEmailLogging(string ErrorMessage)
        {
          
            MailMessage mailMsg = new MailMessage(); // Create instance of EmailMessage Object

            string templateName = FrameworkLayer.ConfigurationUtility.WebApplicationConfiguration.ProgrammerEmailName;
            mailMsg.From = FrameworkLayer.ConfigurationUtility.WebApplicationConfiguration.EmailSender;
            mailMsg.To = FrameworkLayer.ConfigurationUtility.WebApplicationConfiguration.ProgrammerEmail;
            //mailMsg.Cc = EmailUser;

(more…)

Add comment July 5, 2007

Multipurpose of Exception Handling Class Part 2

Okay in this section part i will talk more detail about those kind of class ,

  1. Logging Class

Prerequisite for this class :

  • You need provide the xml file for become the email template, the simple form like this :<EMAIL>
    <TITLE>Error Notification</TITLE>
    <MESSAGE>
    <SUBJECT>Global Coding System Notification
    </SUBJECT>
    <BODY>ERROR MESSAGE ALERT {0}
    ================================================\n\nPlease be advised that somthing error happen in your application :
    {1} \N
    </BODY>
    </MESSAGE>
    </EMAIL>

(more…)

Add comment July 5, 2007

Multipurpose of Exception Handling Class Part 1

In this Part, i will share of my code project which is i have made the multipurpose exception handling class. What is the trully meaning of multipurpose ? in this class i have create the exception handling class which covered the function for throwing the exception message and also giving the email alert notification to the programmer or event for system administrator.

for instance is like this :

in DAL i am using the exception handling class –> if there is something error in my DAL class –> the error handler will capture the Exception stack trace –> the Exception class will talk to the Logging class and also either the email class.

and then my class like this Logging class and Email class :

log

(more…)

Add comment July 2, 2007

Multipurpose Data Access Layer part 2

In this 2nd part i’ll try to describe more detail in coding which i mentioned it in part 1,

a. ConnectionString Class

  • First Of all you need to save your connection string variable in your web config, in my case i put all of the setting in particular configuration setting class which being taken from webconfig setting.
  • I must inherit from the WebPageBase class for become the master of base page class, this WebPageBase class inherit the System.web.UI.Page , this class will become the property provider to every page in Web UI such as retrive the current user,current password and of course the applicationID that we need.
  • And the last thing i made two public static method which return the string of connectionstring and providername, both of those method will filter the appropriate connection string and provider name which inputed from each outside ( define input parameter ).

     let see the complete module :

     (more…)

Add comment July 2, 2007


 

July 2007
M T W T F S S
« Jun   Dec »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

Recent Posts

Archives

Category Cloud

Design Pattern Code Development in C# 2.0 Development in C# 3.0 Dotnet Framework 2.0 Dotnet Framework 3.0 Own design custom Framework Pattern and Practise

Blog Stats

Top Posts

Blogroll

Recent Comments

Top Clicks

Feeds

Tags