public void TestInitialize() { _fixture = new Fixture(); _httpClient = new Mock <IHttpClient>(MockBehavior.Strict); _courseSource = new CourseSource(_httpClient.Object); }
protected void Button_InsertCourse_Click(object sender, EventArgs e) { if (IsValid) { CourseSource.InsertParameters["Crs_Name"].DefaultValue = TextBox_Crs_Name.Text; CourseSource.InsertParameters["Crs_Duration"].DefaultValue = TextBox_Crs_Duration.Text; CourseSource.Insert(); TextBox_Crs_Name.Text = string.Empty; TextBox_Crs_Duration.Text = string.Empty; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Role"].ToString() != "Admin") { Response.Redirect("../Anonymous/ErrorPage.aspx"); } if (!Page.IsPostBack) { CourseSource.SelectParameters["st_id"].DefaultValue = ((Label)GridView_st.Rows[0].Cells[0].FindControl("Label_St_Id")).Text; CourseSource.Select(); } }
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { CourseSource.SelectParameters["st_id"].DefaultValue = ((Label)GridView_st.Rows[e.NewSelectedIndex].Cells[0].FindControl("Label_St_Id")).Text; CourseSource.Select(); }