protected void hdnValue_ValueChanged(object sender, EventArgs e)
        {
            string projNum = ((HiddenField)sender).Value;

            DataTable dt = new DataTable();

            dt = Project.GetProjects("GetProjectIdByProjNum", projNum.ToString());

            ///populate the form based on retrieved data
            if (dt.Rows.Count > 0)
            {
                lblProjNameText.Visible = true;

                if (txtFromCommitedProjNum.Text.ToLower() == "all")
                {
                    lblProjName.Text = "All";
                }
                else
                {
                    DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(Convert.ToInt32(dt.Rows[0][0].ToString()));
                    lblProjName.Text = dtProjects.Rows[0]["Description"].ToString();

                    hfProjId.Value = dt.Rows[0][0].ToString();
                }
            }
            else
            {
                lblProjNameText.Visible = false;
                lblProjName.Text        = "";
            }
        }
        protected void ddlProjFilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            lblErrorMsg.Text = "";

            gvTransactions.DataSource = null;
            gvTransactions.DataBind();

            pnlTranDetails.Visible = false;

            if (ddlProjFilter.SelectedIndex != 0)
            {
                int ProjectNo = Convert.ToInt32(ddlProjFilter.SelectedValue.ToString());
                lblProjNameText.Visible = true;

                if (ProjectNo == -1)
                {
                    lblProjName.Text = "All";
                }
                else
                {
                    DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(ProjectNo);
                    lblProjName.Text = dtProjects.Rows[0]["Description"].ToString();
                }
            }
            else
            {
                lblProjNameText.Visible = false;
                lblProjName.Text        = "";
            }
        }
Exemplo n.º 3
0
        protected void ddlProjFilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            pnlTranDetails.Visible = false;
            lblErrorMsg.Text       = "";

            gvPTrans.DataSource = null;
            gvPTrans.DataBind();

            ddlGrantee.Items.Clear();
            ddlGrantee.Items.Insert(0, new ListItem("Select", "NA"));

            ClearTransactionDetailForm();

            if (ddlProjFilter.SelectedIndex != 0)
            {
                DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(Convert.ToInt32(ddlProjFilter.SelectedValue.ToString()));
                lblProjNameText.Visible = true;
                lblProjName.Text        = dtProjects.Rows[0]["Description"].ToString();
                BindGranteeByProject(); //Bind Grantee Drop Down
                txtTransDate.Text = DateTime.Now.ToShortDateString();
                txtTotAmt.Text    = "";
                BindFundAccounts();
            }
            else
            {
                lblProjNameText.Visible = false;
                lblProjName.Text        = "";
            }
        }
Exemplo n.º 4
0
        private void getDetails(DataTable dt)
        {
            try
            {
                if (dt.Rows.Count != 0)
                {
                    hfProjId.Value         = dt.Rows[0][0].ToString();
                    pnlTranDetails.Visible = false;
                    lblErrorMsg.Text       = "";

                    gvPTrans.DataSource = null;
                    gvPTrans.DataBind();

                    ClearTransactionDetailForm();
                    DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(Convert.ToInt32(hfProjId.Value));

                    lblProjName.Text = dtProjects.Rows[0]["Description"].ToString();
                    dt = new DataTable();
                    dt = FinancialTransactions.GetGranteeByProject(Convert.ToInt32(hfProjId.Value));
                    if (dt.Rows.Count > 0)
                    {
                        lblGrantee.Text = dt.Rows[0]["Applicantname"].ToString();
                        hfGrantee.Value = dt.Rows[0]["applicantid"].ToString();
                    }
                    else
                    {
                        lblGrantee.Text = "";
                        hfGrantee.Value = "";
                    }

                    txtTransDate.Text = DateTime.Now.ToShortDateString();
                    txtTotAmt.Text    = "";
                    BindFundAccounts();
                    ifProjectNotes.Src = "ProjectNotes.aspx?ProjectId=" + hfProjId.Value;

                    if (rdBtnSelection.SelectedIndex == 1)
                    {
                        DataTable dtTrans = FinancialTransactions.GetFinancialTransByProjId(Convert.ToInt32(hfProjId.Value), ActiveOnly, BOARD_COMMITMENT);
                        gvPTrans.DataSource = dtTrans;
                        gvPTrans.DataBind();
                        CommonHelper.DisableButton(btnTransactionSubmit);
                    }
                    else if (rdBtnSelection.SelectedIndex == 0)
                    {
                        CommonHelper.EnableButton(btnTransactionSubmit);
                    }
                }
                else
                {
                    lblProjName.Text = "";
                }
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text = ex.Message;
            }
        }
Exemplo n.º 5
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;
            }
        }
Exemplo n.º 6
0
        protected void ddlProjFilter_SelectedIndexChanged(object sender, EventArgs e)
        {
            pnlTranDetails.Visible = false;
            lblErrorMsg.Text       = "";

            gvPTrans.DataSource = null;
            gvPTrans.DataBind();

            ddlGrantee.Items.Clear();
            ddlGrantee.Items.Insert(0, new ListItem("Select", "NA"));

            ClearTransactionDetailForm();

            if (ddlProjFilter.SelectedIndex != 0)
            {
                DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(Convert.ToInt32(ddlProjFilter.SelectedValue.ToString()));
                lblProjNameText.Visible = true;
                lblProjName.Text        = dtProjects.Rows[0]["Description"].ToString();
                BindGranteeByProject(); //Bind Grantee Drop Down

                txtTransDate.Text = DateTime.Now.ToShortDateString();
                txtTotAmt.Text    = "";
                BindFundAccounts();
                ifProjectNotes.Src = "ProjectNotes.aspx?ProjectId=" + ddlProjFilter.SelectedValue.ToString();

                if (rdBtnSelection.SelectedIndex == 1)
                {
                    DataTable dtTrans = FinancialTransactions.GetFinancialTransByProjId(Convert.ToInt32(ddlProjFilter.SelectedValue), ActiveOnly, BOARD_COMMITMENT);
                    gvPTrans.DataSource = dtTrans;
                    gvPTrans.DataBind();
                    CommonHelper.DisableButton(btnTransactionSubmit);
                }
                else if (rdBtnSelection.SelectedIndex == 0)
                {
                    CommonHelper.EnableButton(btnTransactionSubmit);
                }
            }
            else
            {
                lblProjNameText.Visible = false;
                lblProjName.Text        = "";
            }
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
        private void getDetails(DataTable dt)
        {
            try
            {
                lblAvailFund.Text        = "";
                lblAvailVisibleFund.Text = "";
                if (dt.Rows.Count != 0)
                {
                    hfProjId.Value = dt.Rows[0][0].ToString();
                    DataRow dr = ProjectCheckRequestData.GetAvailableFundsByProject(int.Parse(hfProjId.Value));
                    if (dr != null)
                    {
                        if (Convert.ToDecimal(dr["availFund"].ToString()) > 0)
                        {
                            lblAvailFund.Text        = Convert.ToDecimal(dr["availFund"].ToString()).ToString("#.##");
                            lblAvailVisibleFund.Text = CommonHelper.myDollarFormat(Convert.ToDecimal(dr["availFund"].ToString()));
                            //.ToString("#.##");
                        }
                        else
                        {
                            lblAvailFund.Text        = "0.00";
                            lblAvailVisibleFund.Text = "0.00";
                        }
                    }

                    pnlTranDetails.Visible = false;
                    lblErrorMsg.Text       = "";

                    gvPTrans.DataSource = null;
                    gvPTrans.DataBind();

                    ClearTransactionDetailForm();
                    DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(Convert.ToInt32(hfProjId.Value));

                    lblProjName.Text = dtProjects.Rows[0]["Description"].ToString();
                    dt = new DataTable();
                    dt = FinancialTransactions.GetGranteeByProject(Convert.ToInt32(hfProjId.Value));
                    if (dt.Rows.Count > 0)
                    {
                        lblGrantee.Text = dt.Rows[0]["Applicantname"].ToString();
                        hfGrantee.Value = dt.Rows[0]["applicantid"].ToString();
                    }
                    else
                    {
                        lblGrantee.Text = "";
                        hfGrantee.Value = "";
                    }

                    txtTransDate.Text = DateTime.Now.ToShortDateString();
                    txtTotAmt.Text    = "";
                    BindFundAccounts();
                    ifProjectNotes.Src = "ProjectNotes.aspx?ProjectId=" + hfProjId.Value;

                    if (rdBtnSelection.SelectedIndex == 1)
                    {
                        DataTable dtTrans = FinancialTransactions.GetFinancialTransByProjId(Convert.ToInt32(hfProjId.Value), ActiveOnly, BOARD_REFUND);
                        gvPTrans.DataSource = dtTrans;
                        gvPTrans.DataBind();
                        CommonHelper.DisableButton(btnTransactionSubmit);
                    }
                    else if (rdBtnSelection.SelectedIndex == 0)
                    {
                        CommonHelper.EnableButton(btnTransactionSubmit);
                    }
                }
                else
                {
                    lblProjName.Text = "";
                }
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text = ex.Message;
            }
        }
        protected void btnSubit_click(object sender, EventArgs e)
        {
            DateTime tranFromDate;
            DateTime tranToDate;

            #region Validation
            //if (ddlProjFilter.Items.Count > 1 && ddlProjFilter.SelectedIndex == 0)
            //{
            //    lblErrorMsg.Text = "Select Project";
            //    ddlProjFilter.Focus();
            //    return;
            //}
            //            else
            if (ddlFinancialTrans.Items.Count > 1 && ddlFinancialTrans.SelectedIndex == 0)
            {
                lblErrorMsg.Text = "Select financial transaction";
                ddlFinancialTrans.Focus();
                return;
            }
            else if (txtTransDateFrom.Text.Trim() == "")
            {
                lblErrorMsg.Text = "Select Transaction From Date";
                txtTransDateFrom.Focus();
                return;
            }
            else if (txtTransDateTo.Text.Trim() == "")
            {
                lblErrorMsg.Text = "Select Transaction End Date";
                txtTransDateTo.Focus();
                return;
            }
            else
            {
                if (!DateTime.TryParse(txtTransDateFrom.Text.Trim(), out tranFromDate))
                {
                    lblErrorMsg.Text = "Select valid transaction From date";
                    txtTransDateFrom.Focus();
                    return;
                }
                if (!DateTime.TryParse(txtTransDateTo.Text.Trim(), out tranToDate))
                {
                    lblErrorMsg.Text = "Select valid transaction To date";
                    txtTransDateTo.Focus();
                    return;
                }
                if (tranFromDate > DateTime.Today)
                {
                    lblErrorMsg.Text = "From Transaction date should be less than or equal to today";
                    txtTransDateFrom.Focus();
                    return;
                }
                if (tranToDate > DateTime.Today)
                {
                    lblErrorMsg.Text = "Transaction End date should be less than or equal to today";
                    txtTransDateTo.Focus();
                    return;
                }
                if (tranFromDate > tranToDate)
                {
                    lblErrorMsg.Text = "From Transaction date should be less than End date";
                    txtTransDateFrom.Focus();
                    return;
                }
            }
            #endregion

            ViewState["FromDate"] = tranFromDate;
            ViewState["EndDate"]  = tranToDate;

            lblProjNameText.Visible = true;
            lblProjName.Text        = "";

            if (hfProjId.Value != "")
            {
                PopulateTransactions(Convert.ToInt32(hfProjId.Value), tranFromDate, tranToDate, Convert.ToInt32(ddlFinancialTrans.SelectedValue.ToString()));
                DataTable dtProjects = FinancialTransactions.GetBoardCommitmentsByProject(Convert.ToInt32(hfProjId.Value));
                lblProjName.Text = dtProjects.Rows[0]["Description"].ToString();
            }
            else
            {
                lblProjName.Text = "All";
                PopulateTransactions(-1, tranFromDate, tranToDate, Convert.ToInt32(ddlFinancialTrans.SelectedValue.ToString()));
            }
        }