Example #1
0
        private void BindSelectedProjects()
        {
            try
            {
                if (ddlProjFilter.SelectedIndex != 0)
                {
                    DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(Convert.ToInt32(ddlProjFilter.SelectedValue.ToString()));

                    lblProjName.Text = dtProjects.Rows[0]["Description"].ToString();
                    //txtGrantee.Text = dtProjects.Rows[0]["Applicantname"].ToString();
                    BindGranteeByProject();
                    DataTable dtTrans = FinancialTransactions.GetBoardCommitmentTrans(Convert.ToInt32(ddlProjFilter.SelectedValue.ToString()), "Board Decommitment");
                    if (dtTrans.Rows.Count > 0)
                    {
                        gvPTrans.DataSource = dtTrans;
                        gvPTrans.DataBind();
                        txtTransDate.Text       = Convert.ToDateTime(dtTrans.Rows[0]["Date"].ToString()).ToShortDateString();
                        txtTotAmt.Text          = dtTrans.Rows[0]["TransAmt"].ToString();
                        ddlStatus.SelectedValue = dtTrans.Rows[0]["lkStatus"].ToString();
                        if (dtTrans.Rows.Count == 1)
                        {
                            BindFundDetails(Convert.ToInt32(ddlProjFilter.SelectedValue.ToString()));
                        }
                        else
                        {
                            gvBCommit.DataSource = null;
                            gvBCommit.DataBind();
                        }
                    }
                    else
                    {
                        txtTransDate.Text       = DateTime.Now.ToShortDateString();
                        txtTotAmt.Text          = "";
                        ddlStatus.SelectedIndex = 1;
                        gvPTrans.DataSource     = null;
                        gvPTrans.DataBind();
                        gvBCommit.DataSource = null;
                        gvBCommit.DataBind();
                    }
                }
                else
                {
                    lblErrorMsg.Text = "Select a project to proceed";
                }
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text = ex.Message;
            }
        }
Example #2
0
        protected void gvPTrans_Sorting(object sender, GridViewSortEventArgs e)
        {
            SortExpression = e.SortExpression;
            DataTable dtTrans = new DataTable();

            if (ddlProjFilter.SelectedIndex != 0)
            {
                DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(Convert.ToInt32(ddlProjFilter.SelectedValue.ToString()));

                lblProjName.Text = dtProjects.Rows[0]["Description"].ToString();
                // txtGrantee.Text = dtProjects.Rows[0]["Applicantname"].ToString();
                BindGranteeByProject();
                dtTrans = FinancialTransactions.GetBoardCommitmentTrans(Convert.ToInt32(ddlProjFilter.SelectedValue.ToString()), "Board Decommitment");
                if (dtTrans.Rows.Count > 0)
                {
                    gvPTrans.DataSource = dtTrans;
                    gvPTrans.DataBind();
                }
            }
            SortDireaction = CommonHelper.GridSorting(gvBCommit, dtTrans, SortExpression, SortDireaction);
        }