The Nissan Club banner

1 - 10 of 10 Posts

·
Banned
Joined
·
45 Posts
Discussion Starter #1
wtf.

Code:
namespace MES_WDI
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using MES_WDI_Tools;

	/// <summary>
	///		Summary description for HighSchoolDropDown.
	/// </summary>
	/// 
	
	public class HighSchoolDropDown : System.Web.UI.UserControl
	{
		protected System.Web.UI.WebControls.DropDownList ddlbHighSchool;

		private void Page_Load(object sender, System.EventArgs e)
		{
			if(!Page.IsPostBack)
			{
				ddlbHighSchool.DataSource = ContentDB.GetContent("GetHighSchools");
				ddlbHighSchool.DataValueField = "HIGH_SCHOOL_ID";
				ddlbHighSchool.DataTextField = "NAME";
				ddlbHighSchool.DataBind();
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

	}
}
 

·
Banned
Joined
·
45 Posts
Discussion Starter #2
stored procedure name is "GetHighSchools" it returns "HIGH_SCHOOL_ID" and "NAME". The drop down I'm trying to populate is named "ddlbHighSchool".

that should work, correct?
 

·
Banned
Joined
·
45 Posts
Discussion Starter #3
ass, asses, asshole, assholes, bastard , beastial, beastiality, beastility, bestial, bestiality, bitch, bitcher, bitchers, bitches, bitchin, bitching, blowjob, blowjobs, clit, cock, cocks, cocksuck, cocksucked, cocksucker, cocksucking, cocksucks , cum, cummer, cumming, cums, cumshot, cunilingus, cunillingus, cunnilingus, cunt, cuntlick, cuntlicker, cuntlicking, cunts, cyberfuc, cyberfuck, cyberfucked, cyberfucker, cyberfuckers, cyberfucking, damn, dildo, dildos, dink, dinks, ejaculate, ejaculated, ejaculates, ejaculating, ejaculatings, ejaculation, fag, fagging, faggot, faggs, fagot, fagots, fags, fart, farted, farting, fartings, farts, farty, felatio, fellatio, fingerfuck, fingerfucked, fingerfucker, fingerfuckers, fingerfucking, fingerfucks, fistfuck, fistfucked, fistfucker, fistfuckers, fistfucking, fistfuckings, fistfucks, fuck, fucked, fucker, fuckers, fuckin, fucking, fuckings, fuckme, fucks, fuk, fuks, gangbang, gangbanged, gangbangs, gaysex, goddamn, hardcoresex, hell, horniest, horny, hotsex, jack-off, jerk-off, jism, jiz, jizm, kock, kondum, kondums, kum, kummer, kumming, kums, kunilingus, lust, lusting, mothafuck, mothafucka, mothafuckas, mothafuckaz, mothafucked, mothafucker, mothafuckers, mothafuckin, mothafucking, mothafuckings, mothafucks, motherfuck, motherfucked, motherfucker, motherfuckers, motherfuckin, motherfucking, motherfuckings, motherfucks, orgasim, orgasims, orgasm, orgasms, phonesex, phuk, phuked, phuking, phukked, phukking, phuks, phuq, piss, pissed, pisser, pissers, pisses, pissin, pissing, pissoff, porn, porno, pornography, pornos, prick, pricks, pussies, pussy, pussys, shit, shited, shitfull, shiting, shitings, shits, shitted, shitter, shitters, shitting, shittings, shitty, slut, sluts, smut, spunk, twat
 

·
Banned
Joined
·
45 Posts
Discussion Starter #7
woot. here's the solution in case any of you ever encounter the same problem.

[email protected]~1

Code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using MES_WDI_Tools;

namespace MES_WDI.npif
{
	/// <summary>
	/// Summary description for education2_edit.
	/// </summary>
	public class education2_edit : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.LinkButton btnSubmit;
		protected System.Web.UI.WebControls.LinkButton btnCancel;
		protected System.Web.UI.WebControls.Label Label3;
		protected System.Web.UI.WebControls.Label Label4;
		protected System.Web.UI.WebControls.Label lblFeedback;
		protected System.Web.UI.WebControls.Image imgGradDate;
		protected System.Web.UI.WebControls.Label lblCourseName;
		protected System.Web.UI.WebControls.RequiredFieldValidator rfvGradeReceived;
		protected System.Web.UI.WebControls.RegularExpressionValidator revGradeReceived;
		protected System.Web.UI.WebControls.Label lblYearTaken;
		protected System.Web.UI.WebControls.TextBox txtYearTaken;
		protected System.Web.UI.WebControls.TextBox txtGradeReceived;
		protected System.Web.UI.WebControls.Label lblGradeReceived;
		protected System.Web.UI.WebControls.TextBox txtCourseName;
		protected System.Web.UI.WebControls.RequiredFieldValidator rfvCourseName;
		protected System.Web.UI.WebControls.RequiredFieldValidator Requiredfieldvalidator1;
		protected System.Web.UI.WebControls.RegularExpressionValidator Regularexpressionvalidator1;
		protected System.Web.UI.WebControls.Label lblGPAHint;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			AppFunctions.CheckNpifUSERID();	
			AppFunctions.CheckNpifStatus();
			
			if(!Page.IsPostBack)
			{
				int ID = Convert.ToInt32(Request.Params["ID"]);
	
				if(ID != 0 )
				{
					//This is an existing record and there is a numeric ID.//
					SqlDataReader dr = GetDB.GetSingleRow("GetHighSchoolCourses",Convert.ToInt32(Session["USERID"].ToString()));

					// Read in first row from database
					dr.Read();

					txtCourseName.Text = (String) Functions.isDBNULL(dr["COURSE_NAME"]);
					txtGradeReceived.Text =  (String) Functions.isDBNULL(dr["GRADE_RECEIVED"]);
					txtYearTaken.Text = (String) Functions.isDBNULL(dr["YEAR_TAKEN"]);
			
					// Close datareader
					dr.Close();					
				}
			}
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void btnCancel_Click(object sender, System.EventArgs e)
		{
			Server.Transfer("/MES_WDI/npif/education2.aspx");
		}

		private void btnSelectSchool_Click(object sender, System.EventArgs e)
		{
			Server.Transfer("/MES_WDI/npif/education2_school.aspx?ID=" + Request.Params["ID"].ToString());
		}

		private void btnSubmit_Click(object sender, System.EventArgs e)
		{
			if(Page.IsValid)
			{
				string strSubmit = "";
				int ID = Convert.ToInt32(Request.Params["ID"]);
			

				if(ID == 0)
				{
					strSubmit = educationDB.AddEducation2edit(
						Convert.ToInt32(Session["USERID"].ToString()),
						txtCourseName.Text.ToString(),
						txtGradeReceived.Text.ToString(),
						txtYearTaken.Text.ToString());
				}
				else
				{
					strSubmit = educationDB.UpdateEducation2edit(
						Convert.ToInt32(Session["USERID"].ToString()),
						ID,
						txtCourseName.Text.ToString(),
						txtGradeReceived.Text.ToString(),
						txtYearTaken.Text.ToString());
				}
				// Handle the return here. If it is "y" then all was successful.   //
				// Otherwise the error message is returned and it is displayed in  //
				// the label control.                                              //
				if(strSubmit == "y")
				{
					Session["School"] = "";
					Session["SchoolCode"] = "";
					Server.Transfer("/MES_WDI/npif/education2.aspx",true);
				}
				else	
				{
					//lblFeedback.Text = ConfigurationSettings.AppSettings["SaveError"].ToString();
					lblFeedback.Text = strSubmit.ToString();
				}
			
			}

		}
	}
}
and

Code:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace MES_WDI_Tools
{
	/// <summary>
	/// Summary description for educationDB.
	/// </summary>
	public class educationDB
	{
		public educationDB()
		{

		}
		public static string ProcessEducation1(string strGradType,int intUSERID,int intUpdatedBY)
			{
				string strSubmit;

				// Create Instance of Connection and Command Object
				SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
				SqlCommand myCommand = new SqlCommand("ProcessEducation1", myConnection);

				myConnection.Open();

				// Mark the Command as a SPROC
				myCommand.CommandType = CommandType.StoredProcedure;

				SqlParameter parameterGradType = new SqlParameter("@grad_type", SqlDbType.VarChar);
				parameterGradType.Value = strGradType;
				myCommand.Parameters.Add(parameterGradType);

				SqlParameter parameterUSERID = new SqlParameter("@USERID",SqlDbType.Int);
				parameterUSERID.Value = intUSERID;
				myCommand.Parameters.Add(parameterUSERID);

				SqlParameter parameterUpdatedBY = new SqlParameter("@UPDATED_BY",SqlDbType.Int);
				parameterUpdatedBY.Value = intUpdatedBY;
				myCommand.Parameters.Add(parameterUpdatedBY);

			
				try
				{
					strSubmit = "y";
					myCommand.ExecuteNonQuery();
				}

				catch(Exception e)
				{
					strSubmit = e.ToString();
				}

				finally
				{
					myConnection.Close();
				}

				return strSubmit;

			}
		public static string ProcessEducation2(string strAbsentHS,string strAbsentReason,int intUSERID,int intUpdatedBY)
		{
			string strSubmit;

			// Create Instance of Connection and Command Object
			SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
			SqlCommand myCommand = new SqlCommand("ProcessEducation2", myConnection);

			myConnection.Open();

			// Mark the Command as a SPROC
			myCommand.CommandType = CommandType.StoredProcedure;

			SqlParameter parameterAbsentHS = new SqlParameter("@ABSENT_HS", SqlDbType.VarChar,1);
			parameterAbsentHS.Value = strAbsentHS;
			myCommand.Parameters.Add(parameterAbsentHS);

			SqlParameter parameterAbsentReason = new SqlParameter("@ABSENT_REASON",SqlDbType.VarChar,500);
			parameterAbsentReason.Value = strAbsentReason;
			myCommand.Parameters.Add(parameterAbsentReason);

			SqlParameter parameterUSERID = new SqlParameter("@USERID",SqlDbType.Int);
			parameterUSERID.Value = intUSERID;
			myCommand.Parameters.Add(parameterUSERID);

			SqlParameter parameterUpdatedBY = new SqlParameter("@UPDATED_BY",SqlDbType.Int);
			parameterUpdatedBY.Value = intUpdatedBY;
			myCommand.Parameters.Add(parameterUpdatedBY);

			
			try
			{
				strSubmit = "y";
				myCommand.ExecuteNonQuery();
			}

			catch(Exception e)
			{
				strSubmit = e.ToString();
			}

			finally
			{
				myConnection.Close();
			}

			return strSubmit;

		}
		
		public static string ProcessEducation3(string strScore,string strDate,int intUSERID,int intUpdatedBY)
		{
			string strSubmit;

			// Create Instance of Connection and Command Object
			SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
			SqlCommand myCommand = new SqlCommand("ProcessEducation3", myConnection);

			myConnection.Open();

			// Mark the Command as a SPROC
			myCommand.CommandType = CommandType.StoredProcedure;

			SqlParameter parameterScore = new SqlParameter("@GED_SCORE", SqlDbType.VarChar,4);
			parameterScore.Value = strScore;
			myCommand.Parameters.Add(parameterScore);

			SqlParameter parameterDate = new SqlParameter("@GED_DATE", SqlDbType.DateTime);
			parameterDate.Value = strDate;
			myCommand.Parameters.Add(parameterDate);

			SqlParameter parameterUSERID = new SqlParameter("@USERID",SqlDbType.Int);
			parameterUSERID.Value = intUSERID;
			myCommand.Parameters.Add(parameterUSERID);

			SqlParameter parameterUpdatedBY = new SqlParameter("@UPDATED_BY",SqlDbType.Int);
			parameterUpdatedBY.Value = intUpdatedBY;
			myCommand.Parameters.Add(parameterUpdatedBY);

			
			try
			{
				strSubmit = "y";
				myCommand.ExecuteNonQuery();
			}

			catch(Exception e)
			{
				strSubmit = e.ToString();
			}

			finally
			{
				myConnection.Close();
			}

			return strSubmit;

		}
		public static string ProcessEducation4(string strName,string strCity, string strState,int intUSERID,int intUpdatedBY)
		{
			string strSubmit;

			// Create Instance of Connection and Command Object
			SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
			SqlCommand myCommand = new SqlCommand("ProcessEducation4", myConnection);

			myConnection.Open();

			// Mark the Command as a SPROC
			myCommand.CommandType = CommandType.StoredProcedure;

			SqlParameter parameterName = new SqlParameter("@COLLEGE_INFO", SqlDbType.VarChar,100);
			parameterName.Value = strName;
			myCommand.Parameters.Add(parameterName);

			SqlParameter parameterCity = new SqlParameter("@COLLEGE_CITY", SqlDbType.VarChar,40);
			parameterCity.Value = strCity;
			myCommand.Parameters.Add(parameterCity);

			SqlParameter parameterState = new SqlParameter("@COLLEGE_STATE", SqlDbType.VarChar,2);
			parameterState.Value = strState;
			myCommand.Parameters.Add(parameterState);

			SqlParameter parameterUSERID = new SqlParameter("@USERID",SqlDbType.Int);
			parameterUSERID.Value = intUSERID;
			myCommand.Parameters.Add(parameterUSERID);

			SqlParameter parameterUpdatedBY = new SqlParameter("@UPDATED_BY",SqlDbType.Int);
			parameterUpdatedBY.Value = intUpdatedBY;
			myCommand.Parameters.Add(parameterUpdatedBY);

			
			try
			{
				strSubmit = "y";
				myCommand.ExecuteNonQuery();
			}

			catch(Exception e)
			{
				strSubmit = e.ToString();
			}

			finally
			{
				myConnection.Close();
			}

			return strSubmit;

		}
		public static string AddEducation2edit(int intUSER_ID, string strCOURSE_NAME, string strGRADE_RECEIVED, string strYEAR_TAKEN)
		{
	
			string strSubmit;

			// Create Instance of Connection and Command Object
			SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
			SqlCommand myCommand = new SqlCommand("ProcessHighSchoolCourses", myConnection);

			myConnection.Open();

			// Mark the Command as a SPROC
			myCommand.CommandType = CommandType.StoredProcedure;
		
			
			SqlParameter parameterUSER_ID = new SqlParameter("@USER_ID", SqlDbType.Int);
			parameterUSER_ID.Value = intUSER_ID;
			myCommand.Parameters.Add(parameterUSER_ID);

			SqlParameter parameterCOURSE_NAME = new SqlParameter("@COURSE_NAME",SqlDbType.VarChar);
			parameterCOURSE_NAME.Value = strCOURSE_NAME;
			myCommand.Parameters.Add(parameterCOURSE_NAME);

			SqlParameter parameterGRADE_RECEIVED= new SqlParameter("@GRADE_RECEIVED", SqlDbType.VarChar);
			parameterGRADE_RECEIVED.Value = strGRADE_RECEIVED;
			myCommand.Parameters.Add(parameterGRADE_RECEIVED);
			
			SqlParameter parameterYEAR_TAKEN = new SqlParameter("@YEAR_TAKEN", SqlDbType.VarChar);
			parameterYEAR_TAKEN.Value = strYEAR_TAKEN;
			myCommand.Parameters.Add(parameterYEAR_TAKEN);
			
			try
			{
				strSubmit = "y";
				myCommand.ExecuteNonQuery();
			}

				catch(Exception e)
			{
				strSubmit = e.ToString();
			}

				finally
			{
				myConnection.Close();
			}

				return strSubmit;
		}

		public static DataSet getSchools(string strState,string strCity,int intScholarshipID)
		{
			// Create Instance of Connection and Command Object
			SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
			SqlDataAdapter myCommand = new SqlDataAdapter("getEducationSchools", myConnection);

			// Mark the Command as a SPROC
			myCommand.SelectCommand.CommandType = CommandType.StoredProcedure;

			// Add parameters to the SPROC
			SqlParameter parameterCity = new SqlParameter("@City",SqlDbType.VarChar);
			parameterCity.Value = strCity;
			myCommand.SelectCommand.Parameters.Add(parameterCity);

			// Add parameters to the SPROC
			SqlParameter parameterState = new SqlParameter("@State",SqlDbType.VarChar);
			parameterState.Value = strState;
			myCommand.SelectCommand.Parameters.Add(parameterState);

			// Add parameters to the SPROC
			SqlParameter parameterScholarshipID = new SqlParameter("@ScholarshipID",SqlDbType.Int);
			parameterScholarshipID.Value = intScholarshipID;
			myCommand.SelectCommand.Parameters.Add(parameterScholarshipID);


			// Create and Fill the DataSet
			DataSet myDataSet = new DataSet();
			myCommand.Fill(myDataSet);

			// Return the DataSet
			return myDataSet;
		}

		public static string UpdateEducation2edit(int intUSER_ID, int intHIGH_SCHOOL_COURSE, string strCOURSE_NAME, string strGRADE_RECEIVED, string strYEAR_TAKEN)
		{
	
			string strSubmit;

			// Create Instance of Connection and Command Object
			SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
			SqlCommand myCommand = new SqlCommand("UpdateHighSchoolCourses", myConnection);

			myConnection.Open();

			// Mark the Command as a SPROC
			myCommand.CommandType = CommandType.StoredProcedure;
		
			
			SqlParameter parameterUSER_ID = new SqlParameter("@USER_ID", SqlDbType.Int);
			parameterUSER_ID.Value = intUSER_ID;
			myCommand.Parameters.Add(parameterUSER_ID);

			SqlParameter parameterHIGH_SCHOOL_COURSE = new SqlParameter("@HIGH_SCHOOL_COURSE", SqlDbType.Int);
			parameterHIGH_SCHOOL_COURSE.Value = intHIGH_SCHOOL_COURSE;
			myCommand.Parameters.Add(parameterHIGH_SCHOOL_COURSE);

			SqlParameter parameterCOURSE_NAME = new SqlParameter("@COURSE_NAME",SqlDbType.VarChar);
			parameterCOURSE_NAME.Value = strCOURSE_NAME;
			myCommand.Parameters.Add(parameterCOURSE_NAME);

			SqlParameter parameterGRADE_RECEIVED= new SqlParameter("@GRADE_RECEIVED", SqlDbType.VarChar);
			parameterGRADE_RECEIVED.Value = strGRADE_RECEIVED;
			myCommand.Parameters.Add(parameterGRADE_RECEIVED);
			
			SqlParameter parameterYEAR_TAKEN = new SqlParameter("@YEAR_TAKEN", SqlDbType.VarChar);
			parameterYEAR_TAKEN.Value = strYEAR_TAKEN;
			myCommand.Parameters.Add(parameterYEAR_TAKEN);

			
			try
			{
				strSubmit = "y";
				myCommand.ExecuteNonQuery();
			}

			catch(Exception e)
			{
				strSubmit = e.ToString();
			}

			finally
			{
				myConnection.Close();
			}

			return strSubmit;
		}

		public static string DeleteEducation2(int intUSERID, int intSEQ)
		{
			string strSubmit;

			// Create Instance of Connection and Command Object
			SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]);
			SqlCommand myCommand = new SqlCommand("DeleteEducation2", myConnection);

			myConnection.Open();

			// Mark the Command as a SPROC
			myCommand.CommandType = CommandType.StoredProcedure;

			SqlParameter parameterUSERID = new SqlParameter("@USERID",SqlDbType.Int);
			parameterUSERID.Value = intUSERID;
			myCommand.Parameters.Add(parameterUSERID);

			SqlParameter parameterSEQ = new SqlParameter("@SEQ_NBR",SqlDbType.Int);
			parameterSEQ.Value = intSEQ;
			myCommand.Parameters.Add(parameterSEQ);

			
			try
			{
				strSubmit = "y";
				myCommand.ExecuteNonQuery();
			}

			catch(Exception e)
			{
				strSubmit = e.ToString();
			}

			finally
			{
				myConnection.Close();
			}

			return strSubmit;
		}
	}
}
with the following stored procedures

Code:
CREATE PROCEDURE [dbo].[ProcessHighSchoolCourses] 

@USER_ID			int,
@COURSE_NAME		varchar(100), 
@GRADE_RECEIVED		varchar(4),
@YEAR_TAKEN		varchar(4)

AS
	INSERT INTO HIGH_SCHOOL_COURSES (USER_ID, COURSE_NAME, GRADE_RECEIVED, YEAR_TAKEN)
	VALUES (@USER_ID, @COURSE_NAME, @GRADE_RECEIVED, @YEAR_TAKEN)
GO
and

Code:
CREATE PROCEDURE [dbo].[UpdateHighSchoolCourses] 

@USER_ID			int,
@HIGH_SCHOOL_COURSES   	int,
@COURSE_NAME		varchar(100), 
@GRADE_RECEIVED		varchar(4),
@YEAR_TAKEN		varchar(4)

AS
	UPDATE HIGH_SCHOOL_COURSES 
		SET USER_ID = @USER_ID,
		COURSE_NAME =  @COURSE_NAME,
		GRADE_RECEIVED = @GRADE_RECEIVED,
		YEAR_TAKEN = @YEAR_TAKEN
	WHERE
		HIGH_SCHOOL_COURSES = @HIGH_SCHOOL_COURSES
GO
 
1 - 10 of 10 Posts
Top