Example #1
0
 protected void ddlRFromFund_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlRFromFund.SelectedIndex > 0)
     {
         //ddlRFromFundType.DataSource = FinancialTransactions.GetAvailableTransTypesPerProjFundId(Convert.ToInt32(ddlRFromProj.SelectedValue.ToString()), Convert.ToInt32(ddlRFromFund.SelectedValue.ToString()));
         ddlRFromFundType.DataSource     = FinancialTransactions.GetAvailableTransTypesPerProjFundId(Convert.ToInt32(hfProjId.Value), Convert.ToInt32(ddlRFromFund.SelectedValue.ToString()));
         ddlRFromFundType.DataValueField = "typeid";
         ddlRFromFundType.DataTextField  = "fundtype";
         ddlRFromFundType.DataBind();
         lblAvailVisibleFund.Text = "";
         lblAvailFund.Text        = "";
         if (ddlRFromFundType.Items.Count > 1)
         {
             ddlRFromFundType.Items.Insert(0, new ListItem("Select", "NA"));
             clearGvReallocate();
         }
         else if (ddlRFromFundType.Items.Count == 1)
         {
             if (rdBtnSelection.SelectedIndex > 0)
             {
                 BindGvReallocate(Convert.ToInt32(hfProjId.Value), Convert.ToInt32(ddlRFromFund.SelectedValue.ToString()), Convert.ToInt32(ddlRFromFundType.SelectedValue.ToString()));
             }
             else
             {
                 clearGvReallocate();
             }
         }
     }
 }
Example #2
0
        protected void ddlRFromFund_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ddlRFromFund.SelectedIndex > 0)
            {
                //ddlRFromFundType.DataSource = FinancialTransactions.GetAvailableTransTypesPerProjFundId(Convert.ToInt32(ddlRFromProj.SelectedValue.ToString()), Convert.ToInt32(ddlRFromFund.SelectedValue.ToString()));
                ddlRFromFundType.DataSource     = FinancialTransactions.GetAvailableTransTypesPerProjFundId(Convert.ToInt32(hfProjId.Value), Convert.ToInt32(ddlRFromFund.SelectedValue.ToString()));
                ddlRFromFundType.DataValueField = "typeid";
                ddlRFromFundType.DataTextField  = "fundtype";
                ddlRFromFundType.DataBind();
                lblAvailVisibleFund.Text = "";
                lblAvailFund.Text        = "";
                if (ddlRFromFundType.Items.Count > 1)
                {
                    ddlRFromFundType.Items.Insert(0, new ListItem("Select", "NA"));
                }
                else if (ddlRFromFundType.Items.Count == 1)
                {
                    DataTable dtable = FinancialTransactions.GetCommittedFundDetailsByFundId(Convert.ToInt32(hfProjId.Value), Convert.ToInt32(ddlRFromFund.SelectedValue.ToString()));
                    if (dtable.Rows.Count > 0)
                    {
                        lblAvailVisibleFund.Text = CommonHelper.myDollarFormat(Convert.ToDecimal(dtable.Rows[0]["balance"].ToString()));
                        lblAvailFund.Text        = Convert.ToDecimal(dtable.Rows[0]["balance"].ToString()).ToString();
                    }
                    if (rdBtnSelection.SelectedIndex > 0)
                    {
                        BindGvReallocate(Convert.ToInt32(hfProjId.Value), Convert.ToInt32(ddlRFromFund.SelectedValue.ToString()));
                    }
                }

                if (txtToProjNum.Text != "")
                {
                    //if (ddlRToProj.SelectedValue != ddlRFromProj.SelectedValue)
                    if (txtToProjNum.Text != txtFromProjNum.Text)
                    {
                        ddlRToFund.SelectedValue = ddlRFromFund.SelectedValue;
                        ddlRToFund.Enabled       = false;
                    }
                    else
                    {
                        ddlRToFund.Enabled = true;
                    }
                }
            }
        }