Ejemplo n.º 1
0
 protected void btnView_Click(object sender, EventArgs e)
 {
     PanelView.Visible = true;
     GridViewIndex.DataBind();
     GridViewIndex.Visible = true;
 }
Ejemplo n.º 2
0
    protected void Butsave_Click(object sender, EventArgs e)
    {
        int         result = 0, result1 = 0;
        Business    B = new Business();
        IndexManage R = new IndexManage();

        log.Debug("inside Butsave_Click");
        string AgencyId = TextIndexAgencyCode.Text;

        try
        {
            string userid = Session["UserId"].ToString();

            string Agencyname = TextIndexAgencyName.Text.Trim();

            R.AgencyId   = AgencyId;
            R.AgencyName = Agencyname;
            R.Uid        = userid;


            int ret = checkupdateinsert(sender, e);

            if (ret == 0)
            {
                result = B.IndexAgencyInsert(R);
            }
            else
            {
                R.Active = DrpActInactive.SelectedValue;
                result1  = B.IndexAgencyUpdate(R);
            }


            if (result == 1)
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Index Data Saved Successfully')</script>");
                log.Info("Index Data Saved Successfully, Code:" + AgencyId);
                TextIndexAgencyCode.Enabled = true;
                TextIndexAgencyCode.Text    = "";
                TextIndexAgencyName.Text    = "";
                popupPanelPop.Visible       = false;
            }

            if (result1 == 1)
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Index Data updated  Successfully')</script>");
                log.Info("Index Data updated Successfully");
                GridViewIndex.DataBind();
                TextIndexAgencyCode.Text    = "";
                TextIndexAgencyName.Text    = "";
                status.Visible              = false;
                TextIndexAgencyCode.Enabled = true;
                DrpActInactive.Visible      = false;
                GridViewIndex.Visible       = false;
                popupPanelPop.Visible       = false;
            }
        }
        catch (Exception ex)
        {
            log.Error("Inside Catch Block Of IndexAgency_M Creation" + ex.Message + " For Index code " + AgencyId + " With UserID" + Session["UserId"].ToString());
            log.Error(ex.StackTrace);


            ClientScript.RegisterStartupScript(Page.GetType(), "validation1", "<script language='javascript'>alert('Error!!!!!!!!! ')</script>");
        }
    }