コード例 #1
0
    protected void radbt1_click(object sender, EventArgs e)
    {
        if (rad_but1.Checked == true)
        {
            ddlcategory.Visible = true;
            DDL_Subcat.Visible  = true;
            txt_newcat.Visible  = false;
            txtsub.Visible      = false;
            link_add.Visible    = true;
            link_subcat.Visible = true;

            ddlcategory.DataSource     = s.getcategory(rad_but1.Text);
            ddlcategory.DataTextField  = "Category";
            ddlcategory.DataValueField = "id";
            ddlcategory.DataBind();

            int catid = Convert.ToInt16(ddlcategory.SelectedItem.Value);
            DDL_Subcat.DataSource     = s.getscat(catid);
            DDL_Subcat.DataTextField  = "Subcategory";
            DDL_Subcat.DataValueField = "id";
            DDL_Subcat.DataBind();

            ddl_Fyr.SelectedIndex        = -1;
            ddl_Tyr.SelectedIndex        = -1;
            ddl_degtype.SelectedIndex    = -1;
            txt_totalFund.Text           = "0";
            ddl_percentage.SelectedIndex = -1;
            txt_af.Text             = "0";
            txt_std_allocated.Text  = "1";
            lblbal.Visible          = false;
            lbl_balance.Visible     = false;
            txt_newtotalfnd.Visible = false;
            btn_tf_save.Visible     = false;

            Bindgrid();
            chkisMou.Checked = true;
            chkisMou.Enabled = false;
            lbl_app.Visible  = false;
            lblmsg.Visible   = false;
        }
    }
コード例 #2
0
 protected void ddlcategory_selectedindexchanged(object sender, EventArgs e)
 {
     try
     {
         {
             int catid = Convert.ToInt16(ddlcategory.SelectedItem.Value);
             DDL_Subcat.DataSource     = s.getscat(catid);
             DDL_Subcat.DataTextField  = "Subcategory";
             DDL_Subcat.DataValueField = "id";
             DDL_Subcat.DataBind();
             lblmsg.Visible = false;
             DataTable dt = s.getTotalFund(Convert.ToInt16(DDL_Subcat.SelectedItem.Value));
             if (dt.Rows.Count > 0)
             {
                 txt_totalFund.Text = dt.Rows[0]["totalfund"].ToString();
             }
             ddl_Fyr.SelectedIndex        = -1;
             ddl_Tyr.SelectedIndex        = -1;
             ddl_degtype.SelectedIndex    = -1;
             txt_totalFund.Text           = "0";
             ddl_percentage.SelectedIndex = -1;
             txt_af.Text             = "0";
             txt_std_allocated.Text  = "1";
             lblbal.Visible          = false;
             lbl_balance.Visible     = false;
             txt_newtotalfnd.Visible = false;
             btn_tf_save.Visible     = false;
             Bindgrid();
             chkisMou.Checked = true;
             chkisMou.Enabled = false;
             lbl_app.Visible  = false;
             lblmsg.Visible   = false;
         }
     }
     catch
     {
     }
 }
コード例 #3
0
    protected void GvTOC_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "EditRow")
        {
            chk_renewal.Checked = false;
            pnl_Renewal.Visible = true;
            string[] arg = new string[2];
            arg = e.CommandArgument.ToString().Split(';');
            HiddenField1.Value = Convert.ToString(arg[0]);
            HiddenField3.Value = Convert.ToString(arg[1]);
            DataTable dt       = s.getcategorygrid(Convert.ToInt32(HiddenField1.Value), Convert.ToBoolean(HiddenField3.Value));
            string    checkitm = "";
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["ISMOU"].ToString() == "True")
                {
                    rad_but1.Checked = true;
                    checkitm         = rad_but1.Text;
                    string gg = dt.Rows[0]["ISMOU"].ToString();
                }
                else
                {
                    rad_but2.Checked = true;
                    checkitm         = rad_but2.Text;
                    string gg = dt.Rows[0]["ISMOU"].ToString();
                }
                ddlcategory.Items.Clear();
                ddlcategory.DataSource     = s.getcategory(checkitm);
                ddlcategory.DataTextField  = "Category";
                ddlcategory.DataValueField = "id";
                ddlcategory.DataBind();
                ddlcategory.SelectedValue = dt.Rows[0]["Id"].ToString();
                int catid = Convert.ToInt16(ddlcategory.SelectedItem.Value);
                DDL_Subcat.DataSource     = s.getscat(catid);
                DDL_Subcat.DataTextField  = "Subcategory";
                DDL_Subcat.DataValueField = "id";
                DDL_Subcat.DataBind();
                DDL_Subcat.SelectedValue = dt.Rows[0]["SubcatId"].ToString();
                // txtsub.Text = dt.Rows[0]["SubCategory"].ToString();
                if (Convert.ToBoolean(dt.Rows[0]["Isactive"]) == true)
                {
                    chkIsActive.Checked = true;
                }
                else
                {
                    chkIsActive.Checked = false;
                }
                //ddl_Acadyr.SelectedValue = dt.Rows[0]["acadYearId"].ToString();
                ddl_Fyr.SelectedItem.Text  = dt.Rows[0]["FromYear"].ToString(); //getting f_year Id as acadyearid for percentage selection
                ddl_Fyr.SelectedItem.Value = dt.Rows[0]["acadYearId"].ToString();
                ddl_Tyr.SelectedItem.Text  = dt.Rows[0]["ToYear"].ToString();
                ddl_degtype.SelectedValue  = dt.Rows[0]["DegreeId"].ToString();
                int acyrid = Convert.ToInt16(dt.Rows[0]["acadYearId"].ToString());
                int degid  = Convert.ToInt16(ddl_degtype.SelectedItem.Value);
                txt_totalFund.Text = dt.Rows[0]["TotalFund"].ToString();
                //ddl_percentage.DataSource = s.getpercentage1();
                //ddl_percentage.DataTextField = "Percentage";
                //ddl_percentage.DataValueField = "Percentage";
                //ddl_percentage.DataBind();
                ddl_percentage.DataSource     = s.getpercentage(acyrid, degid);
                ddl_percentage.DataTextField  = "Percentage";
                ddl_percentage.DataValueField = "Percentage";
                ddl_percentage.DataBind();
                ddl_percentage.SelectedValue = dt.Rows[0]["Percentage"].ToString();
                percen_Amt.Text        = dt.Rows[0]["PercenAmt"].ToString();
                txt_af.Text            = dt.Rows[0]["ApproveFund"].ToString();
                txt_std_allocated.Text = dt.Rows[0]["StdAlloted"].ToString();
                if (Convert.ToBoolean(dt.Rows[0]["IsMOU"]) == true)
                {
                    chkisMou.Checked = true;
                }
                else
                {
                    chkisMou.Checked = false;
                }

                if (Convert.ToBoolean(dt.Rows[0]["IsSharjahGov"].ToString()) == true)
                {
                    chk_IsSharjah.Checked = true;
                }
                else
                {
                    chk_IsSharjah.Checked = false;
                }
            }
            lblmsg.Visible    = false;
            Button1.Visible   = false;
            btnupdate.Visible = true;
        }
        if (e.CommandName == "DeleteRow")
        {
            StudentRegistrationDAL d = new StudentRegistrationDAL();
            HiddenField1.Value = Convert.ToString(e.CommandArgument);
            d.Deletecategory(Convert.ToInt32(HiddenField1.Value));
            lblmsg.Text = "Successfully Changed the state as Inactive";
        }
        Bindgrid();
    }