protected void btnsubmitoffers_Click(object sender, EventArgs e) { DAC_EnrollCourse oDAC_EnrollCourse = new DAC_EnrollCourse(); REF_EnrollCourse oREF_EnrollCourse = new REF_EnrollCourse(); oREF_EnrollCourse.CusID = dropCusotmer.Value; oREF_EnrollCourse.CourseID = dropCourse.Value; oREF_EnrollCourse.OfferID = dropoffers.Value; DataTable dt; DAV_Offers oDAV_Offers = new DAV_Offers(); REF_Offers oREF_Offers = new REF_Offers(); oREF_Offers.ID = Convert.ToInt32(dropoffers.Value); dt = oDAV_Offers.SelectOffersByID(oREF_Offers); Double OfferPrice = Double.Parse(dt.Rows[0][6].ToString()); oREF_EnrollCourse.offer_prices = dt.Rows[0][6].ToString(); DAV_Cources oDAV_Cources = new DAV_Cources(); REF_Course oREF_Course = new REF_Course(); oREF_Course.ID = Convert.ToInt32(dropCourse.Value); dt = oDAV_Cources.SelectCourseByID(oREF_Course); Double CoursePrice = Double.Parse(dt.Rows[0][4].ToString()); Double Total = CoursePrice - OfferPrice; oREF_EnrollCourse.Course_price = dt.Rows[0][3].ToString(); oREF_EnrollCourse.Total = Total.ToString(); oDAC_EnrollCourse.Insert(oREF_EnrollCourse); LoadData(); }
protected void btndelete_Click(object sender, EventArgs e) { DAV_Cources oDAV_Cources = new DAV_Cources(); REF_Course oREF_Course = new REF_Course(); oREF_Course.ID = Convert.ToInt32(CourseID);; oDAV_Cources.Delete(oREF_Course); Response.Redirect("./frmAddCourse.aspx", true); }
protected void btnupdate_Click(object sender, EventArgs e) { DAV_Cources oDAV_Cources = new DAV_Cources(); REF_Course oREF_Course = new REF_Course(); oREF_Course.ID = Convert.ToInt32(CourseID);; oREF_Course.COURSENAME = CourseName.Text; oREF_Course.COURSEDURATION = CourceDuration.Text; oREF_Course.COURSEPRICE = CourcePrice.Text; oREF_Course.DESCRIPTION = Description.Text; oREF_Course.STATUS = 0; oREF_Course.COURSECODE = CourseCode.Text; oDAV_Cources.Update(oREF_Course); Response.Redirect("./frmAddCourse.aspx", true); }
public void LoadData(REF_Course oREF_Course) { DataTable dt; DAV_Cources oDAV_Cources = new DAV_Cources(); dt = oDAV_Cources.SelectCourseByID(oREF_Course); CourseName.Text = dt.Rows[0][2].ToString(); CourceDuration.Text = dt.Rows[0][3].ToString();; CourcePrice.Text = dt.Rows[0][4].ToString();; Description.Text = dt.Rows[0][5].ToString();; CourseCode.Text = dt.Rows[0][1].ToString(); btnupdate.Visible = true; btndelete.Visible = true; btnsubmitCource.Visible = false; }
private void LoadCourse() { DataTable dt; DAV_Cources oDAV_Cources = new DAV_Cources(); dt = oDAV_Cources.SelectCourse(); if (dt.Rows.Count > 0) { dropCourse.DataSource = null; dropCourse.DataSource = dt; dropCourse.DataTextField = "course_name"; dropCourse.DataValueField = "idmaincourse"; dropCourse.DataBind(); } LoadData(); }
protected void btnsubmitCource_Click(object sender, EventArgs e) { try { DAV_Cources oDAV_Cources = new DAV_Cources(); REF_Course oREF_Course = new REF_Course(); oREF_Course.COURSENAME = CourseName.Text; oREF_Course.COURSEDURATION = CourceDuration.Text; oREF_Course.COURSEPRICE = CourcePrice.Text; oREF_Course.DESCRIPTION = Description.Text; oREF_Course.STATUS = 0; oREF_Course.COURSECODE = CourseCode.Text; oDAV_Cources.Insert(oREF_Course); ShowMessage("Data Insert successfully!"); LoadData(); } catch (Exception ex) { ShowMessage("Something went wrong! Please try again!"); } }
protected void Button1_Click(object sender, EventArgs e) { DataTable dt; DAV_Offers oDAV_Offers = new DAV_Offers(); REF_Offers oREF_Offers = new REF_Offers(); oREF_Offers.ID = Convert.ToInt32(dropoffers.Value); dt = oDAV_Offers.SelectOffersByID(oREF_Offers); Double OfferPrice = Double.Parse(dt.Rows[0][6].ToString()); DAV_Cources oDAV_Cources = new DAV_Cources(); REF_Course oREF_Course = new REF_Course(); oREF_Course.ID = Convert.ToInt32(dropCourse.Value); dt = oDAV_Cources.SelectCourseByID(oREF_Course); Double CoursePrice = Double.Parse(dt.Rows[0][4].ToString()); Double Total = CoursePrice - OfferPrice; lbltotal.InnerText = "Total Cost Rs." + Total.ToString(); }
public void LoadData() { try { DataTable dt; DAV_Cources oDAV_Cources = new DAV_Cources(); dt = oDAV_Cources.SelectCourse(); String StrInnserHtml = ""; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { StrInnserHtml = StrInnserHtml + "<tr><td>" + dt.Rows[i][1].ToString() + "</td><td>" + dt.Rows[i][2].ToString() + "</td><td>" + dt.Rows[i][3].ToString() + "</td><td> " + dt.Rows[i][4].ToString() + " </td><td> " + dt.Rows[i][5].ToString() + " </td></tr>"; } } divInnerHtml.InnerHtml = StrInnserHtml; } catch (Exception ex) { throw; } }