protected void buttonAdd_Click(object sender, EventArgs e) { if (CheckProgram()) { LabelErrorMessage.Text = ("already exit"); return; } try { string _ProcName = "addProgram"; SqlParameter[] _parameter = { new SqlParameter("@ProgramName", textBoxProgramName.Text), new SqlParameter("@Duration", textBoxDuration.Text) }; int index = db.ExecuteNonQueryByQueryProc(_parameter, _ProcName); if (index > 0) { LabelErrorMessage.Text = "Insert successfull"; GridView1.DataBind(); } else { LabelErrorMessage.Text = "Insert Failed"; } } catch (Exception ex) { LabelErrorMessage.Text = ex.Message; } }
protected void Submit_Click(object sender, EventArgs e) { try { string _ProcName = "ApplyExam"; SqlParameter[] _parameter = { new SqlParameter("@UserName", Session["user"].ToString()), new SqlParameter("@ProgramName", DropDownListProgram.SelectedItem.ToString()), new SqlParameter("@CourseName1", DropDownListCourse.SelectedValue.ToString()), new SqlParameter("@CourseName2", DropDownListCourse2.SelectedValue.ToString()), new SqlParameter("@CourseName3", DropDownListCourse3.SelectedValue.ToString()) }; int index = db.ExecuteNonQueryByQueryProc(_parameter, _ProcName); if (index > 0) { LabelErrorMessage.Text = "successfull"; Response.Redirect("ExamRequestConfirmPage.aspx"); } else { LabelErrorMessage.Text = "Failed"; } } catch (Exception ex) { LabelErrorMessage.Text = ex.Message; } }
protected void Add_Click(object sender, EventArgs e) { if (CheckProgram()) { LabelErrorMessage.Text = ("already exit"); return; } try { string _ProcName = "addCourse"; SqlParameter[] _parameter = { new SqlParameter("@ProgramName", DropDownListProgram.SelectedItem.ToString()), new SqlParameter("@CourseName", textBoxCourse.Text) }; int index = db.ExecuteNonQueryByQueryProc(_parameter, _ProcName); if (index > 0) { LabelErrorMessage.Text = "Insert successfull"; GridView1.DataBind(); } else { LabelErrorMessage.Text = "Insert Failed"; } } catch (Exception ex) { LabelErrorMessage.Text = ex.Message; } }
protected void buttonAdd_Click(object sender, EventArgs e) { try { string _ProcName = "addQuestion"; SqlParameter[] _parameter = { new SqlParameter("@Program", DropDownListProgram.SelectedValue), new SqlParameter("@Course", DropDownListCourse.SelectedValue), new SqlParameter("@Question", TextBoxQuestion.Text), new SqlParameter("@OptionA", TextBoxOptionA.Text), new SqlParameter("@OptionB", TextBoxOptionB.Text), new SqlParameter("@OptionC", TextBoxOptionC.Text), new SqlParameter("@OptionD", TextBoxOptionD.Text), new SqlParameter("@CorrectOption", DropDownListCorrectOption.SelectedValue) }; int index = db.ExecuteNonQueryByQueryProc(_parameter, _ProcName); if (index > 0) { LabelErrorMessage.Text = "Insert successfull"; } else { LabelErrorMessage.Text = "Insert Failed"; } } catch (Exception ex) { LabelErrorMessage.Text = ex.Message; } clear(); }
protected void ButtonSubmit_Click(object sender, EventArgs e) { if (CheckUserName()) { return; } try { DateTime now = DateTime.Now; string date = now.ToString(); string _ProcName = "registration"; SqlParameter[] _parameter = { new SqlParameter("@FirstName", FirstName.Text), new SqlParameter("@LastName", LastName.Text), new SqlParameter("@LoginID", LoginId.Text), new SqlParameter("@Password", Password.Text), new SqlParameter("@Email", Email.Text), new SqlParameter("@Phone", Convert.ToInt64(phone.Text)), new SqlParameter("@Gender", RadioButtonListGender.SelectedValue), new SqlParameter("@DOB", dob.Text), new SqlParameter("@Program", DropDownListProgram.SelectedValue.ToString()), new SqlParameter("@Address", address.Text), new SqlParameter("@StateID", DropDownListState.SelectedValue.ToString()), new SqlParameter("@cityID", DropDownListCity.SelectedValue.ToString()), new SqlParameter("@PinCoad", Convert.ToInt64(PinCode.Text)) /*, * new SqlParameter("@Ts_Created",date), * new SqlParameter("@ts_update",date), * new SqlParameter("@role","0")*/ }; int index = db.ExecuteNonQueryByQueryProc(_parameter, _ProcName); if (index > 0) { LabelErrorMessage.Text = "Insert successfull"; } else { LabelErrorMessage.Text = "Insert Failed"; } } catch (Exception ex) { LabelErrorMessage.Text = ex.Message; } Response.Redirect("RegistrationConfirmPage.aspx"); }
protected void Report() { try { string _ProcName = "ResultSet"; SqlParameter[] _parameter = { new SqlParameter("@UserName", UserName), new SqlParameter("@CourseName", subject_name), new SqlParameter("@NoOfQ", TotQus), new SqlParameter("@Marks", marks), new SqlParameter("@Status", Result) }; int index = db.ExecuteNonQueryByQueryProc(_parameter, _ProcName); } catch (Exception ex) { throw; Response.Write("Try Again"); } }
protected void ButtonSubmit_Click(object sender, EventArgs e) { try { string _ProcName = "updateUserDetails"; SqlParameter[] _parameter = { new SqlParameter("@FirstName", FirstName.Text), new SqlParameter("@LastName", LastName.Text), new SqlParameter("@LoginID", Session["user"].ToString()), new SqlParameter("@Email", Email.Text), new SqlParameter("@Phone", Convert.ToInt64(phone.Text)), new SqlParameter("@Gender", RadioButtonListGender.SelectedValue), new SqlParameter("@DOB", dob.Text), new SqlParameter("@Program", DropDownListProgram.SelectedValue.ToString()), new SqlParameter("@Address", address.Text), new SqlParameter("@StateID", DropDownListState.SelectedValue.ToString()), new SqlParameter("@cityID", DropDownListCity.SelectedValue.ToString()), new SqlParameter("@PinCoad", Convert.ToInt64(PinCode.Text)) }; int index = db.ExecuteNonQueryByQueryProc(_parameter, _ProcName); if (index > 0) { LabelErrorMessage.Text = "successfull Updated"; Response.Redirect("EditProfile.aspx"); } else { LabelErrorMessage.Text = "Insert Failed"; } } catch (Exception ex) { LabelErrorMessage.Text = ex.Message; } }