Search blogs  
Browse by category
RAMESH NAIDU - dotnet developer
Ramesh Babu Akula
Author:Ramesh Babu Akula
Software engineer
SAMPLE .NET APPLICATION IN 3 TIER

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using SASClassLibrary;

public partial class InterimSemester_InterimCoursesAdd : System.Web.UI.Page

{

private BLL.InterimSemesterCoursesLogic intersemCousrse = new BLL.InterimSemesterCoursesLogic();

protected void Page_Load(object sender, EventArgs e)

{

if (Page.IsPostBack == false)

{

BindList();

}

}

public void BindList()

{

DataSet ds = intersemCousrse.getAcademicYear1(); ;

ddlAcademicYear.DataSource = ds;

ddlAcademicYear.DataTextField = "AcademicYear";

ddlAcademicYear.DataValueField = "AcademicId";

ddlAcademicYear.DataBind();

ddlAcademicYear.Items.Insert(0, "Select");

ddlAcademicYear.Items[0].Value = "0";

}

protected void btnSave_Click(object sender, EventArgs e)

{

Page.Validate();

if (Page.IsValid)

{

try

{

intersemCousrse.AcademicId = ddlAcademicYear.SelectedItem.Value.ToString();

intersemCousrse.CourseName = txtCourseName.Text;

intersemCousrse.Description = txtDescription.Text;

intersemCousrse.Fee=txtFee.Text;

intersemCousrse.MaximumEnrolments=txtMaximumEnrolments.Text;

intersemCousrse.CreatedBy=Guid.NewGuid().ToString();

intersemCousrse.UpdatedBy = Guid.NewGuid().ToString();

intersemCousrse.InsertInterimSemesterCourses();

Page.ClientScript.RegisterStartupScript(this.GetType(), "SaveScript", "SucessSave();", true);

}

catch (Exception err)

{

lblError.Text = err.Message;

}

}

else

{

lblError.Text = "Fields marked '*' are compulsory.";

lblError.Visible = true;

}

}

protected void btnBack_Click(object sender, EventArgs e)

{

Response.Redirect("InterimCoursesSearch.aspx");

}

}

using System;

using System.Collections.Generic;

using System.Text;

using SASClassLibrary;

using DAL;

using System.Data;

using System.Data.Common;

namespace BLL

{

public class InterimSemesterCoursesLogic

{

private DAL.DataAccessLayer Insemdataacesslayer = null;

private string _AcademicId;

private string _CourseName;

private string _Description;

private string _Fee;

private string _MaximumEnrolments;

private string _CreatedBy;

private string _CreatedOn = DateTime.Now.ToString();

private string _UpdatedBy;

private string _UpdatedOn = DateTime.Now.ToString();

public InterimSemesterCoursesLogic()

{

Insemdataacesslayer = new DAL.DataAccessLayer();

}

public string AcademicId

{

get

{

return _AcademicId;

}

set

{

if (value.ToString() == "")

{

_AcademicId = "";

}

else

{

_AcademicId = value;

}

}

}

public string CourseName

{

get

{

return _CourseName;

}

set

{

if (value.ToString() == "")

{

_CourseName = "";

}

else

{

_CourseName = value;

}

}

}

public string Description

{

get

{

return _Description;

}

set

{

if (value.ToString() == "")

{

_Description = "";

}

else

{

_Description = value;

}

}

}

public string Fee

{

get

{

return _Fee;

}

set

{

if (value.ToString() == "")

{

_Fee = "";

}

else

{

_Fee = value;

}

}

}

public string MaximumEnrolments

{

get

{

return _MaximumEnrolments;

}

set

{

if (value.ToString() == "")

{

_MaximumEnrolments = "";

}

else

{

_MaximumEnrolments = value;

}

}

}

public string CreatedBy

{

get

{

return _CreatedBy;

}

set

{

if (value.ToString() == "")

{

_CreatedBy = "";

}

else

{

_CreatedBy = value;

}

}

}

public string UpdatedBy

{

get

{

return _UpdatedBy;

}

set

{

if (value.ToString() == "")

{

_UpdatedBy = "";

}

else

{

_UpdatedBy = value;

}

}

}

public bool InsertInterimSemesterCourses()

{

try

{

return Insemdataacesslayer.InsertInterimSemesterCoures(AcademicId, CourseName, Description, Fee, MaximumEnrolments, CreatedBy, _CreatedOn, UpdatedBy, _UpdatedOn);

}

catch (Exception ex)

{

throw ex;

}

}

public DataSet getAcademicYear1()

{

return Insemdataacesslayer.getAcademicYear();

}

public DataSet getCourseList()

 
Comments
Comment 1: By keyur narkhi on 03rd Sep 2008
this blog really good .. i m fan of c# so wait for your next good blog

Post your valuable comment here
Email:      Password:  
Don't have SiliconIndia ID? Sign up      Forgot your Password?  Retrieve

 Latest postings

C# Modifiers
Modifiers    C#:1)Static :1)Use the static modifier to declare a static member, which belongs to the type itself rather than to a speci... more >>
DOTNET5
What is the need of abstraction? What is abstraction? What is the abstraction for stack?Abstraction is nothing but binding the code and data Toge... more >>
SQLSERVER FAQS
SQLSERVER 2005 Interview Questions If I want to see what fields a table is made of, and what the sizes of thefields... more >>
Asp.net Authentication and Authorization
Authentication and AuthorizationAuthentication and Authorization are two interrelated security concepts. In short, authentication is a process of iden... more >>
asp.net
ASP.NET State Management Web form pages are HTTP-Based, they are stateless, which means they don’t know whether the requests are all from the same... more >>
More postings 1  2  3    next >>

Career

GROOMING for men and women
Grooming means dressing well, to be presentable to others. You ma... more >>
By
ravi kanth
BOSS is never happy !!!
BOSS is never happy !!!! This is dedicated to all bosses who are ... more >>
By
Nitin Gupta
Are you doing what you like?
It's definitely worth thinking about! So many of us end up choo... more >>
By
Diana Menezes
STAR
Aries (March 21-April 19)Arians are trendsetters in fashi... more >>
By
Hariharan Janardhanan
The Five Myths of Leadership
Mike Griffiths, Project Manager, Quadrus Developmen, December... more >>
By
Sundaram, S

Guest contributors

S Ramdorai
S Ramdorai
CEO, TCS
Stephen J Felice
Stephen J Felice
Senior VP and President, Asia-Pacific, Dell
Jayshree V Ullal
Jayshree V Ullal
Senior Vice President / General Manager, Cisco
Dr. Krishna Mikilineni
Dr. Krishna Mikilineni
Managing Director, Honeywell Technology Solutions Lab.
Jan Money
Jan Money
Senior Vice President, Freescale Semiconductor
 Our sponsors