protected void btnpaypanalty_Click(object sender, EventArgs e) { if (txtpanalty.Text == "") { lblpay.Text = "Enter amount"; } else if (txtdetail.Text == "") { lblpay.Text = "Enter detail"; } else { PAdapter.PENALTY_PAY_NOW(Convert.ToDouble(txtpanalty.Text), txtdetail.Text, Convert.ToInt32(drpbook.SelectedValue)); lblmsg.Text = "Amount paid successfully"; RAdapter.RENT_SELECT_RETURN(Convert.ToInt32(ViewState["RRID"].ToString()), 1, Convert.ToInt32(ViewState["BBID"].ToString())); txtdetail.Text = ""; txtpanalty.Text = ""; MultiView1.ActiveViewIndex = -1; SDT = SAdapter.Select_Student_for_panalty(); drpstudent.DataSource = SDT; drpstudent.DataTextField = "StudentName"; drpstudent.DataValueField = "sid"; drpstudent.DataBind(); drpstudent.Items.Insert(0, "SELECT"); drpbook.Items.Clear(); drpbook.Items.Insert(0, "SELECT"); } }
protected void Button1_Click(object sender, EventArgs e) { if (rdolibrary.Checked == true) { ADT = AAdapter.Select_for_LOGIN(txtuname.Text, txtupass.Text); if (ADT.Rows.Count > 0) { Session["aid"] = ADT.Rows[0]["aid"].ToString(); Session["email"] = txtuname.Text; Session["name"] = ADT.Rows[0]["name"].ToString(); Response.Redirect("Home.aspx"); } else { lbl.Text = "Invalid Credential"; } } else { SDT = SAdapter.Select_for_LOGIN(txtuname.Text, txtupass.Text); if (SDT.Rows.Count > 0) { Session["sid"] = SDT.Rows[0]["sid"].ToString(); Session["email"] = txtuname.Text; Response.Redirect("Student/Default.aspx"); } else { lbl.Text = "Invalid Credential"; } } }
protected void drpbranch_SelectedIndexChanged(object sender, EventArgs e) { SDT = SAdapter.Select_By_Branch(drpbranch.SelectedItem.Text); drpstudent.DataSource = SDT; drpstudent.DataTextField = "Studentname"; drpstudent.DataValueField = "sid"; drpstudent.DataBind(); drpstudent.Items.Insert(0, "SELECT"); }
protected void Page_Load(object sender, EventArgs e) { if (Session["sid"] == null) { Response.Redirect("../Default.aspx"); } SDT = SAdapter.Select_By_SID(Convert.ToInt32(Session["sid"].ToString())); Image2.ImageUrl = SDT.Rows[0]["image"].ToString(); lblname.Text = SDT.Rows[0]["studentname"].ToString(); }
protected void Button13_Click(object sender, EventArgs e) { MultiView1.ActiveViewIndex = 1; SDT = SAdapter.Select_By_SID(Convert.ToInt32(Session["sid"].ToString())); txtname.Text = SDT.Rows[0]["Studentname"].ToString(); txtname0.Text = SDT.Rows[0]["mobile"].ToString(); txtname1.Text = SDT.Rows[0]["address"].ToString(); txtname2.Text = SDT.Rows[0]["city"].ToString(); txtname3.Text = SDT.Rows[0]["pincode"].ToString(); txtname4.Text = SDT.Rows[0]["email"].ToString(); }
protected void Button12_Click(object sender, EventArgs e) { MultiView1.ActiveViewIndex = 0; SDT = SAdapter.Select_By_SID(Convert.ToInt32(Session["sid"].ToString())); lblnam.Text = SDT.Rows[0]["Studentname"].ToString(); lblmobile.Text = SDT.Rows[0]["mobile"].ToString(); lbladd.Text = SDT.Rows[0]["address"].ToString(); lblcity.Text = SDT.Rows[0]["city"].ToString(); lblpincode.Text = SDT.Rows[0]["pincode"].ToString(); lblemail.Text = SDT.Rows[0]["email"].ToString(); }
protected void Page_Load(object sender, EventArgs e) { lblmsg.Text = ""; lblpay.Text = ""; if (Page.IsPostBack == false) { SDT = SAdapter.Select_Student_for_panalty(); drpstudent.DataSource = SDT; drpstudent.DataTextField = "StudentName"; drpstudent.DataValueField = "sid"; drpstudent.DataBind(); drpstudent.Items.Insert(0, "SELECT"); } }
protected void btnseach_Click(object sender, EventArgs e) { if (txtsearch.Text == "") { lblmsg.Text = "Enter student name !!"; } else { SDT = SAdapter.Select_For_SEARCH(txtsearch.Text + "%"); GridView1.DataSource = SDT; GridView1.DataBind(); MultiView1.ActiveViewIndex = 0; lbl.Text = GridView1.Rows.Count.ToString() + " Student Found."; } }
protected void Button12_Click(object sender, EventArgs e) { if (drppublication.SelectedIndex == 0) { lblmsg.Text = "Select Student"; lblmsg.ForeColor = System.Drawing.Color.Red; MultiView1.ActiveViewIndex = -1; } else if (drpbook.SelectedIndex == 0) { lblmsg.Text = "Select Book"; lblmsg.ForeColor = System.Drawing.Color.Red; MultiView1.ActiveViewIndex = -1; } else { MultiView1.ActiveViewIndex = 0; BookDT = BookAdapter.Select_By_BNAM(drpbook.SelectedItem.Text); ViewState["BBID"] = BookDT.Rows[0]["BookID"].ToString(); lblbname.Text = BookDT.Rows[0]["Bookname"].ToString(); lblauthor.Text = BookDT.Rows[0]["author"].ToString(); lblbran.Text = BookDT.Rows[0]["branch"].ToString(); lblpub.Text = BookDT.Rows[0]["publication"].ToString(); lblprice.Text = BookDT.Rows[0]["price"].ToString(); Image2.ImageUrl = BookDT.Rows[0]["Image"].ToString(); SDT = SAdapter.Select_By_SID(Convert.ToInt32(drppublication.SelectedValue)); lblstudent.Text = SDT.Rows[0]["Studentname"].ToString(); RDT = RAdapter.Select_SID_BName_Status(drpbook.SelectedItem.Text, Convert.ToInt32(drppublication.SelectedValue), 0); lbldays.Text = RDT.Rows[0]["Days"].ToString(); lblidate.Text = RDT.Rows[0]["IssueDate"].ToString(); ViewState["RRID"] = RDT.Rows[0]["rid"].ToString(); int iday = Convert.ToDateTime(RDT.Rows[0]["IssueDate"].ToString()).Day; int rday = System.DateTime.Now.Day; int pday = rday - iday; if (pday > Convert.ToInt32(lbldays.Text)) { lblpanalty.Text = "Yes"; } else { lblpanalty.Text = "NO"; } } }
protected void Button11_Click(object sender, EventArgs e) { if (drpbranch.SelectedIndex == 0) { lblmsg.Text = "Select Branch !!"; MultiView1.ActiveViewIndex = -1; } else { SDT = SAdapter.Select_By_Branch(drpbranch.SelectedItem.Text); GridView1.DataSource = SDT; GridView1.DataBind(); MultiView1.ActiveViewIndex = 0; lbl.Text = GridView1.Rows.Count.ToString() + " Student Found."; } }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { MultiView1.ActiveViewIndex = 1; SDT = SAdapter.Select_By_SID(Convert.ToInt32(e.CommandArgument.ToString())); lblid.Text = SDT.Rows[0]["sid"].ToString(); lblname.Text = SDT.Rows[0]["studentname"].ToString(); lblbranch.Text = SDT.Rows[0]["branchname"].ToString(); lblmobile.Text = SDT.Rows[0]["mobile"].ToString(); lbladdress.Text = SDT.Rows[0]["address"].ToString(); lblcity.Text = SDT.Rows[0]["city"].ToString(); lblpin.Text = SDT.Rows[0]["pincode"].ToString(); DateTime dobb = Convert.ToDateTime(SDT.Rows[0]["dob"].ToString()); lbldob.Text = dobb.GetDateTimeFormats()[7].ToString(); lblemai.Text = SDT.Rows[0]["email"].ToString(); lblpass.Text = SDT.Rows[0]["password"].ToString(); }