Exemplo n.º 1
0
        protected void Button8_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 1;
            DataRow Studr = StudentMst.GetDataByKey(int.Parse(Session["SID"].ToString()));
            //StuAdapter.Select_UNAME(Session["sname"].ToString());
            DataTable LeaveDT = LeaveMst.GetAllActiveData().Select("studentId = '" + Studr["SID"].ToString() + "'").CopyToDataTable();

            GridView1.DataSource = LeaveDT;
            GridView1.DataBind();
        }
        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 btnreject_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 2;
            DataTable LeaveDT = LeaveMst.GetAllDataRecordByStId("Reject");

            //LeaveAdapter.Select_By_STD_and_STATUS(drpstd.SelectedItem.Text, "Reject");

            GridView3.DataSource = LeaveDT;
            GridView3.DataBind();
            lblrej.Text = GridView3.Rows.Count.ToString();
        }
        protected void btnnewleave_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 0;
            DataTable LeaveDT = LeaveMst.GetAllDataRecordByStId("Pending");

            //.Select_By_STD_and_STATUS(drpstd.SelectedItem.Text, "Pending");

            GridView1.DataSource = LeaveDT;
            GridView1.DataBind();
            lblnew.Text = GridView1.Rows.Count.ToString();
        }
Exemplo n.º 5
0
 protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Approve")
     {
         LeaveMst leaveMst = new LeaveMst();
         leaveMst.LID   = int.Parse(e.CommandArgument.ToString());
         leaveMst.Reply = "Approved";
         leaveMst.UpdateDataByKey();
         MultiView1.ActiveViewIndex = 2;
         Bindgridview("Approved");
         lblrej.Text = GridView3.Rows.Count.ToString();
     }
 }
Exemplo n.º 6
0
 protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Reject")
     {
         LeaveMst leaveMst = new LeaveMst();
         leaveMst.LID   = int.Parse(e.CommandArgument.ToString());
         leaveMst.Reply = "Approved";
         leaveMst.UpdateDataByKey();
         //LeaveAdapter.LeaveMst_UPDATE_STATU(Convert.ToInt32(e.CommandArgument.ToString()), "Reject");
         //leaveMst.UpdateDataByKey();
         Bindgridview("Reject");
         lblapp.Text = GridView2.Rows.Count.ToString();
     }
 }
Exemplo n.º 7
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Approve")
            {
                LeaveMst leaveMst = new LeaveMst();
                leaveMst.LID   = int.Parse(e.CommandArgument.ToString());
                leaveMst.Reply = "Approve";
                leaveMst.UpdateDataByKey();

                // LeaveAdapter.LeaveMst_UPDATE_STATU(Convert.ToInt32(e.CommandArgument.ToString()), "Approve");
                MultiView1.ActiveViewIndex = 0;
                Bindgridview("Approve");
                lblnew.Text = GridView1.Rows.Count.ToString();
            }
            else
            {
            }
        }
Exemplo n.º 8
0
        protected void Bindgridview(string status)
        {
            try
            {
                if (Session["SID"] != null)
                {
                    int staffId = int.Parse(Session["SID"].ToString());

                    DataRow drstaff = StaffMst.GetDataByKey(staffId);
                    if (drstaff != null)
                    {
                        DataTable LeaveDT = LeaveMst.GetAllDataRecordByStId(status, int.Parse(drstaff["StdId"].ToString()));
                        GridView3.DataSource = LeaveDT;
                        GridView3.DataBind();
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 9
0
 protected void btnappluleave_Click(object sender, EventArgs e)
 {
     try
     {
         DataRow StuDT = StudentMst.GetDataByKey(int.Parse(Session["SID"].ToString()));
         //St StuAdapter.Select_UNAME(Session["sname"].ToString());
         LeaveMst leaveobj = new LeaveMst();
         leaveobj.LID       = LeaveMst.GetNewLID();
         leaveobj.Name      = StuDT["Name"].ToString();
         leaveobj.StudentId = int.Parse(Session["SID"].ToString());
         leaveobj.Nodays    = DropDownList1.SelectedIndex > 0 ? int.Parse(DropDownList1.SelectedValue) : 1;
         leaveobj.Rollno    = "";
         leaveobj.Message   = txtmsg.Text;
         leaveobj.Insert();
         lbl.Text    = "Apply for leave successfully";
         txtmsg.Text = "";
         DropDownList1.SelectedIndex = 0;
     }
     catch (Exception ex)
     {
         lbl.Text = "Apply for leave failed";
     }
 }