protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { DataTable CompDT = Complainmst.GetAllActiveData(); GridView1.DataSource = CompDT; GridView1.DataBind(); } lbl.Text = ""; }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { // StuDT = StuAdapter.Select_UNAME(Session["sname"].ToString()); DataTable std = StdMst.GetAllActiveData(); int month = DateTime.Now.Month; DataTable attendancedt = CHECKINOUT.GetAllMonthlyAttendanceRecord(int.Parse(Session["Sid"].ToString()), month); if (attendancedt != null && attendancedt.Rows.Count > 0) { lbltotalatt.Text = attendancedt.Rows.Count.ToString(); // AttDT = AttAdapter.Select_Roll_Atatus(StuDT.Rows[0]["rollno"].ToString(), "Present"); try { lblpresent.Text = attendancedt.Select("Status='Present' OR Status='Holiday'").CopyToDataTable().Rows.Count.ToString(); } catch { lblpresent.Text = "0"; } try { lblabsent.Text = attendancedt.Select("Status='Abscent'").CopyToDataTable().Rows.Count.ToString(); } catch { lblabsent.Text = "0"; } // AttDT = AttAdapter.Select_Roll_Atatus(StuDT.Rows[0]["rollno"].ToString(), "Absent"); try { lblleave.Text = attendancedt.Select("Status='Leave'").CopyToDataTable().Rows.Count.ToString(); } catch { lblleave.Text = "0"; } DataTable LeaveDT = LeaveMst.GetAllDataRecordByStId("", null, int.Parse(Session["Sid"].ToString())); lbltotalleave.Text = LeaveDT.Rows.Count.ToString(); DataTable CompDT = Complainmst.GetAllDataRecordByStId("", null, int.Parse(Session["Sid"].ToString())); lbltotalattcompl.Text = CompDT.Rows.Count.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { DataTable CompDT = Complainmst.GetAllDataRecordByStId(""); GridView1.DataSource = CompDT; GridView1.DataBind(); lblcomplain.Text = GridView1.Rows.Count.ToString(); } }
protected void btnreplyy_Click(object sender, EventArgs e) { Complainmst complainobj = new Complainmst(Convert.ToInt32(ViewState["cid"].ToString())); //complainobj.CID = Convert.ToInt32(ViewState["cid"].ToString()); complainobj.Reply = txtans.Text; complainobj.UpdateDataByKey(); txtans.Text = ""; string rno = Session["std"].ToString().Substring(0, 1); bindgrid(); MultiView1.ActiveViewIndex = 0; lblcomplain.Text = GridView1.Rows.Count.ToString(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { MultiView1.ActiveViewIndex = 1; DataRow compdr = Complainmst.GetDataByKey(Convert.ToInt32(e.CommandArgument.ToString())); if (compdr != null) { lblrno.Text = compdr["Rollno"].ToString(); lblname.Text = compdr["name"].ToString(); lblcomp.Text = compdr["message"].ToString(); lblsub.Text = compdr["subject"].ToString(); ViewState["cid"] = compdr["cid"].ToString(); } }
protected void bindgrid() { try { if (Session["SID"] != null) { int staffId = int.Parse(Session["SID"].ToString()); DataRow drstaff = StaffMst.GetDataByKey(staffId); if (drstaff != null) { DataTable compdt = Complainmst.GetAllDataRecordByStId("", int.Parse(drstaff["StdId"].ToString())); GridView1.DataSource = compdt; GridView1.DataBind(); lblcomplain.Text = GridView1.Rows.Count.ToString(); } } } catch { } }
protected void btnsend_Click(object sender, EventArgs e) { try { Complainmst complainObj = new Complainmst(); complainObj.CID = Complainmst.GetNewCID(); complainObj.Edate = DateTime.Now; complainObj.Subject = txtmsg.Text; complainObj.Message = txtsubj.Text; complainObj.StudentId = int.Parse(Session["SID"].ToString()); //StuDT = StuAdapter.Select_UNAME(Session["sname"].ToString()); complainObj.Insert(); DataTable dtcomplain = Complainmst.GetAllActiveData(); GridView1.DataSource = dtcomplain; GridView1.DataBind(); lbl.Text = "complain Sent"; txtmsg.Text = ""; txtsubj.Text = ""; } catch (Exception ex) { lbl.Text = "Fail to submit complain"; } }