Ejemplo n.º 1
0
 protected void btnViewAll_Click(object sender, EventArgs e)
 {
     ddlSearchYear.SelectedIndex           = 0;
     tbSearchDate.Text                     = "";
     gvStationeryCollectionList.DataSource = StationeryCollectionLogic.getStationeryCollectionList((string)ViewState["deptId"]).OrderByDescending(x => x.DisbursementId);
     gvStationeryCollectionList.DataBind();
 }
Ejemplo n.º 2
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string deptId = (string)ViewState["deptId"];

            if (ddlSearchYear.Text == "" && tbSearchDate.Text == "")
            {
                gvStationeryCollectionList.DataSource = StationeryCollectionLogic.getStationeryCollectionList(deptId);
                gvStationeryCollectionList.DataBind();
            }

            if (ddlSearchYear.Text != "" && tbSearchDate.Text == "")
            {
                gvStationeryCollectionList.DataSource = StationeryCollectionLogic.getStationeryCollectionListByYear(ddlSearchYear.Text, deptId);
                gvStationeryCollectionList.DataBind();
            }

            if (ddlSearchYear.Text == "" && tbSearchDate.Text != "")
            {
                String   dateString = tbSearchDate.Text;
                DateTime date       = DateTime.Parse(dateString);
                gvStationeryCollectionList.DataSource = StationeryCollectionLogic.getStationeryCollectionListByDate(date, deptId);
                gvStationeryCollectionList.DataBind();
            }

            if (ddlSearchYear.Text != "" && tbSearchDate.Text != "")
            {
                String   dateString = tbSearchDate.Text;
                DateTime date       = DateTime.Parse(dateString);
                gvStationeryCollectionList.DataSource = StationeryCollectionLogic.getStationeryCollectionListByDate(date, deptId);
                gvStationeryCollectionList.DataBind();
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!(authMgmt.IsDeptRep(Context.User.Identity.Name)))
            {
                Response.Redirect("~/ErrorPages/Unauthorised");
            }
            else
            {
                if (!IsPostBack)
                {
                    // Only display disbursements associated with user's department
                    string deptId = eService.SearchEmployeeByEmpId((int)Session["employeeId"]).DeptId;
                    ViewState["deptId"] = deptId;

                    DataBind();
                    gvStationeryCollectionList.DataSource = StationeryCollectionLogic.getStationeryCollectionList(deptId).OrderByDescending(x => x.DisbursementId);
                    gvStationeryCollectionList.DataBind();

                    PopulateDropdownYears();
                }
            }
        }