protected void saveSelectedDoc_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        try
        {
            _objMenu = new Bill_Sys_Menu();
            _objMenu.DeleteTxnMenuRole(extCIddlRoleName.Text);
            if (Request.Form["_ctl0:ContentPlaceHolder1:lbTest"] != null)
            {
                String   szIDs = Request.Form["_ctl0:ContentPlaceHolder1:lbTest"].ToString();
                String[] IDs   = szIDs.Split(',');

                for (int i = 0; i < IDs.Length; i++)
                {
                    _objMenu.SaveTxnMenuRole(extCIddlRoleName.Text, Convert.ToInt32(IDs[i].ToString()));
                }
            }
            lblMsg.Text    = "Menu saved Successfully ...!";
            lblMsg.Visible = true;
            BindRoleMenuListBox();
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
Exemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        try {
            objBillSysMenu = new Bill_Sys_Menu();
            for (int i = 0; i < tvwmenu.CheckedNodes.Count; i++)
            {
                if (i == 0)
                {
                    objBillSysMenu.DeleteTxnMenuRole(ddlUserRole.SelectedValue);
                }
                objBillSysMenu.SaveTxnMenuRole(ddlUserRole.SelectedValue, Convert.ToInt32(tvwmenu.CheckedNodes[i].Value));
            }
            BindTreeView();
            lblMsg.Visible = true;
            lblMsg.Text    = "Menu Saved Successfully...!";
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }