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(); }
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(); } }
protected void Page_Load(object sender, EventArgs e) { if (!(authMgmt.IsDeptRep(Context.User.Identity.Name))) { Response.Redirect("~/ErrorPages/Unauthorised"); } else { if (!IsPostBack) { String disbursementId = Request.QueryString["id"]; DataBind(); gvSCDetails.DataSource = StationeryCollectionLogic.getStationeryCollectionDetailsLists(Convert.ToInt32(disbursementId)); gvSCDetails.DataBind(); Disbursement disbursement = StationeryCollectionLogic.getFirstDisbursement(disbursementId); string dateDisbursed = disbursement.DateDisbursed.HasValue ? disbursement.DateDisbursed.Value.ToString("dd MMM yyyy") : "<not available>"; lblMaintainStockCard1.Text = dateDisbursed; lblMaintainStockCard2.Text = disbursement.Status; if (disbursement.Status == "Waiting for Acknowledgement") { lbRemark.Visible = false; } else { txtRemark.Visible = false; lbRemark.Text = disbursement.Remark; Acknowledge.Visible = false; } } } }
protected void Acknowledge_Click(object sender, EventArgs e) { String disbursementId = Request.QueryString["id"]; String remark = txtRemark.Text; StationeryCollectionLogic.acknowledge(disbursementId, remark); Response.Redirect("~/Dept/StationeryCollectionListByDept.aspx"); }
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(); } } }