Пример #1
0
    protected void btn_savenewtotalfund(object sender, EventArgs e)
    {
        int       subcategoryId = Convert.ToInt16(DDL_Subcat.SelectedItem.Value);
        float     totalfund     = Convert.ToSingle(txt_newtotalfnd.Text);
        float     Result        = StudentRegistrationDAL.Updatenewtotalfund(subcategoryId, totalfund);
        int       subcatid      = Convert.ToInt16(DDL_Subcat.SelectedItem.Value);
        string    ayyear        = Convert.ToString(ddl_Fyr.SelectedItem.Text);
        int       degreetypeid  = Convert.ToInt16(ddl_degtype.SelectedItem.Value);
        DataTable dt1           = s.GetMOUBalance(subcatid, ayyear, degreetypeid);

        if (dt1.Rows.Count > 0)
        {
            btnupdate.Visible   = false;
            lbl_balance.Visible = true;
            lbl_balance.Text    = dt1.Rows[0]["Balance"].ToString();
        }
        if (lbl_balance.Text == "0")
        {
            btnupdate.Visible       = false;
            txt_newtotalfnd.Visible = true;
            btn_tf_save.Visible     = true;
        }
        DataTable dt = s.getupdatedtotalfund(subcategoryId);

        if (dt.Rows.Count > 0)
        {
            txt_totalFund.Text = dt.Rows[0]["totalfund"].ToString();
        }
        else
        {
            txt_totalFund.Text = "0";
        }
        txt_newtotalfnd.Visible = false;
        btn_tf_save.Visible     = false;
        //string ss = lbl_balance.Text;
        //if (ss.Contains("-"))
        //{
        //    Response.Write("<script LANGUAGE='JavaScript'>alert('Dear User,You have entered less amount !!!!!!!!') </script>");
        //    //btnupdate.Visible = true;
        //    txt_newtotalfnd.Text = "";
        //    txt_newtotalfnd.Visible = true;
        //    btn_tf_save.Visible = true;
        //    return ;
        //}
        txt_newtotalfnd.Text = "";
        DataTable dtab = s.GetMOUBalance(subcatid, ayyear, degreetypeid);

        if (dtab.Rows.Count > 0)
        {
            float TAF1 = Convert.ToSingle(dtab.Rows[0]["TotalApprovedfund"].ToString());
            if (Convert.ToSingle(txt_totalFund.Text) <= TAF1)
            {
                Response.Write("<script LANGUAGE='JavaScript'>alert('Dear User,You have entered less amount !!!!!!!!') </script>");
                txt_newtotalfnd.Visible = true;
                btn_tf_save.Visible     = true;
                M1.Show();
            }
        }
    }
Пример #2
0
    protected void ddldegree_selectedindex_changed(object sender, EventArgs e)
    {
        try
        {
            txt_std_allocated.Text = "1";
            DataTable dt = s.getTotalFund(Convert.ToInt16(DDL_Subcat.SelectedItem.Value));
            if (dt.Rows.Count > 0)
            {
                txt_totalFund.Text = dt.Rows[0]["totalfund"].ToString();
            }
            lbl_balance.Visible = true;
            lblbal.Visible      = true;

            int       subcatid     = Convert.ToInt16(DDL_Subcat.SelectedItem.Value);
            string    ayyear       = Convert.ToString(ddl_Fyr.SelectedItem.Text);
            int       degreetypeid = Convert.ToInt16(ddl_degtype.SelectedItem.Value);
            DataTable dt1          = s.GetMOUBalance(subcatid, ayyear, degreetypeid);
            if (dt1.Rows.Count > 0)
            {
                // btnupdate.Visible = true;
                lbl_balance.Text = dt1.Rows[0]["Balance"].ToString();
            }
            else
            {
                lblbal.Visible      = false;
                lbl_balance.Visible = false;
            }
            string ss = lbl_balance.Text;
            if (lbl_balance.Text == "0")
            {
                DataTable dtab = s.GetMOUBalance(subcatid, ayyear, degreetypeid);
                if (dtab.Rows.Count > 0)
                {
                    user_ack.Text = "Dear User , Total approved fund is equals to AED: " + dtab.Rows[0]["TotalApprovedfund"].ToString() + ", So Please enter the amount greater than Total Approved Fund !!! ";
                }
                txt_newtotalfnd.Visible = true;
                btn_tf_save.Visible     = true;
                M1.Show();
            }
            else if (ss.Contains("-"))
            {
                //Response.Write("<script LANGUAGE='JavaScript'>alert('Dear User,You have entered less amount !!!!!!!!') </script>");
                //btnupdate.Visible = true;
                DataTable dtab = s.GetMOUBalance(subcatid, ayyear, degreetypeid);
                if (dtab.Rows.Count > 0)
                {
                    user_ack.Text = "Dear User , Total approved fund is equals to AED: " + dtab.Rows[0]["TotalApprovedfund"].ToString() + ", So Please enter the amount greater than Total Approved Fund !!! ";
                }
                M1.Show();
                txt_newtotalfnd.Text    = "";
                txt_newtotalfnd.Visible = true;
                btn_tf_save.Visible     = true;
            }
            int acyrid = Convert.ToInt16(ddl_Fyr.SelectedItem.Value);
            int degid  = Convert.ToInt16(ddl_degtype.SelectedItem.Value);
            ddl_percentage.DataSource     = s.getpercentage(acyrid, degid);
            ddl_percentage.DataTextField  = "Percentage";
            ddl_percentage.DataValueField = "Percentage";
            ddl_percentage.DataBind();
            ddl_percentage.Items.Insert(0, "---Select---");
            // double Approvfund = double.Parse(txt_totalFund.Text) * (double.Parse(ddl_percentage.SelectedValue)) / 100;
            double Approvfund = 0;
            txt_af.Text = Convert.ToString(Approvfund);
        }
        catch
        {
        }
    }