Example #1
0
        protected void gvFund_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                int fundId = Convert.ToInt32(((Label)gvFund.Rows[e.RowIndex].FindControl("lblFundId")).Text);

                HiddenField hfIsActive = (HiddenField)gvFund.Rows[e.RowIndex].Cells[0].FindControl("hfIsActive");
                if (hfIsActive.Value.ToString().ToLower() == "true")
                {
                    FinancialTransactions.DeleteFundInfo(fundId);
                    BindFundInfo();
                }
                else
                {
                    FinancialTransactions.ActivateFundInfo(fundId);
                    BindFundInfo();
                }
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text = ex.Message;
            }
        }