UserBLL public class UserBLL { public UserBLL() { } public Int32 saveUserDetails(clsUser objUser) { UserDAO objADO = new UserDAO(); return objADO.saveUserDetails(objUser); } }
UserDAO public int saveUserDetails(clsUser objUser) { SqlCommand objCmd = new SqlCommand("usp_InsertNewUser"); object result; try { objCmd.Connection = objCon; objCmd.CommandType = CommandType.StoredProcedure; objCmd.Parameters.AddWithValue("@username", objUser.username.ToString()); objCmd.Parameters.AddWithValue("@pwd", objUser.pwd.ToString()); objCmd.Parameters.AddWithValue("@fname", objUser.firstname.ToString()); objCmd.Parameters.AddWithValue("@lname", objUser.lastname.ToString()); objCmd.Parameters.AddWithValue("@contact", objUser.contact.ToString()); if (objCon.State == ConnectionState.Closed) { objCon.Open(); } result = objCmd.ExecuteScalar(); } catch (Exception ex) { return -1; } finally { objCmd.Dispose(); } return Convert.ToInt32(result); }
return objADO.saveUserDetails(objUser);
objUserBLL.saveUserDetails(objUser)
Page_Load
IsPostBack
usp_InsertNewUser
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)