Пример #1
0
    private void CalculateAmount(string id)
    {
        string Elmahid = string.Format("ElmahId: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(Elmahid, System.Reflection.MethodBase.GetCurrentMethod());
        }
        _bill_Sys_Menu = new Bill_Sys_Menu();
        decimal amount;

        try
        {
            amount         = _bill_Sys_Menu.GetICcodeAmount(id);
            txtAmount.Text = Convert.ToDecimal(amount * Convert.ToDecimal(txtUnit.Text)).ToString();
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(Elmahid, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + Elmahid + ".Please share with Technical support.";
            base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(Elmahid, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    protected void BindMainMenuList()
    {
        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
        {
            ListItem _objLI = new ListItem("--- Select Menu --- ", "-1");
            _objMenu = new Bill_Sys_Menu();
            extCIddlMainMenu.DataSource     = _objMenu.GetMainMenuList(txtCompanyID.Text);
            extCIddlMainMenu.DataValueField = "CODE";
            extCIddlMainMenu.DataTextField  = "DESCRIPTION";
            extCIddlMainMenu.DataBind();
            extCIddlMainMenu.Items.Insert(0, _objLI);
        }
        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());
        }
    }
    protected void BindMenuListBox()
    {
        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();
            if (extCIddlMainMenu.Text != "NA")
            {
                lstMenu.DataSource     = _objMenu.GetChildMenu(Convert.ToInt32(extCIddlMainMenu.Text));
                lstMenu.DataTextField  = "SZ_MENU_NAME";
                lstMenu.DataValueField = "I_MENU_ID";
                lstMenu.DataBind();
            }
        }
        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());
        }
    }
Пример #4
0
    void FillChildMenu(TreeNode node)
    {
        string MenuID = node.Value;

        objBillSysMenu = new Bill_Sys_Menu();
        //string connString = ConfigurationManager.AppSettings["Connection_String"];
        //SqlConnection connection = new SqlConnection(connString);
        //SqlCommand command = new SqlCommand("select i_menu_id,sz_menu_name from mst_menu where i_parent_id = '" + MenuID + "'", connection);
        //SqlDataAdapter adapter = new SqlDataAdapter(command);
        DataSet ChildMenuTable = new DataSet();

        ChildMenuTable = objBillSysMenu.GetChildMenu(Convert.ToInt32(MenuID));
        //  adapter.Fill(ChildMenuTable);
        if (ChildMenuTable.Tables.Count > 0)
        {
            foreach (DataRow row in ChildMenuTable.Tables[0].Rows)
            {
                TreeNode newNode = new TreeNode(row["sz_menu_name"].ToString(), row["i_menu_id"].ToString());
                newNode.PopulateOnDemand = true;
                newNode.SelectAction     = TreeNodeSelectAction.None;
                newNode.ShowCheckBox     = true;
                node.ChildNodes.Add(newNode);
            }
        }
    }
Пример #5
0
    private string GenerateMenuID()
    {
        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());
        }
        _arrayList     = new ArrayList();
        _bill_Sys_Menu = new Bill_Sys_Menu();
        string MenuID = "";

        try
        {
            if (extddlParentID.Text.ToString() != "NA" && extddlParentID.Text.ToString() != "")
            {
                _arrayList = _bill_Sys_Menu.GetMenuID(extddlParentID.Text.ToString());
                if (_arrayList[1].ToString() != null && _arrayList[1].ToString() != "")
                {
                    MenuID = _arrayList[0].ToString() + Convert.ToChar(((int)Convert.ToChar(_arrayList[1])) + 1);
                }
                else
                {
                    MenuID = _arrayList[0].ToString() + "A";
                }
            }
            else
            {
                _arrayList = _bill_Sys_Menu.GetMenuID("0");
                MenuID     = Convert.ToChar(((int)Convert.ToChar(_arrayList[0])) + 1) + "A";
            }
        }
        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);
        }
        return(MenuID);

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    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());
        }
    }
Пример #7
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());
        }
    }
Пример #8
0
    protected void extddlIC9Code_extendDropDown_SelectedIndexChanged(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());
        }
        _bill_Sys_Menu = new Bill_Sys_Menu();
        try
        {
            if (txtUnit.Text != "")
            {
                CalculateAmount(extddlIC9Code.Text.ToString());
            }
            else
            {
                txtAmount.Text   = _bill_Sys_Menu.GetICcodeAmount(extddlIC9Code.Text.ToString()).ToString();
                txtTempAmt.Value = _bill_Sys_Menu.GetICcodeAmount(extddlIC9Code.Text.ToString()).ToString();
            }
        }
        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());
        }
    }
Пример #9
0
    protected void PopulateddlUserRole()
    {
        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();

            ddlUserRole.DataSource = objBillSysMenu.GetRoleList();

            ddlUserRole.DataTextField  = "Description";
            ddlUserRole.DataValueField = "Code";
            ddlUserRole.DataBind();

            ListItem objListItem = new ListItem(" --- Select ---", "NA");
            ddlUserRole.Items.Insert(0, objListItem);
        }
        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());
        }
    }
Пример #10
0
    public void FillMasterMenu(TreeNode node)
    {
        objBillSysMenu = new Bill_Sys_Menu();
        //string connString = ConfigurationManager.AppSettings["Connection_String"];
        //SqlConnection connection = new SqlConnection(connString);
        //SqlCommand command = new SqlCommand("select i_menu_id,sz_menu_name from mst_menu where i_parent_id is null", connection);
        //SqlDataAdapter adapter = new SqlDataAdapter(command);
        DataSet MenuTable = new DataSet();

        MenuTable = objBillSysMenu.GetMasterMenu();
        //   adapter.Fill(MenuTable);
        if (MenuTable.Tables.Count > 0)
        {
            foreach (DataRow row in MenuTable.Tables[0].Rows)
            {
                TreeNode newNode = new
                                   TreeNode(row["sz_menu_name"].ToString(), row["i_menu_id"].ToString());
                newNode.PopulateOnDemand = true;
                newNode.ShowCheckBox     = true;
                newNode.SelectAction     = TreeNodeSelectAction.Expand;
                node.ChildNodes.Add(newNode);
            }
        }
    }
Пример #11
0
    protected void BindTreeView()
    {
        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
        {
            foreach (TreeNode treenode in tvwmenu.Nodes[0].ChildNodes)
            {
                if (treenode.ChildNodes.Count > 0)
                {
                    foreach (TreeNode childTreenode in treenode.ChildNodes)
                    {
                        childTreenode.Checked = false;
                    }
                }

                treenode.Checked = false;
            }

            //string connString = ConfigurationManager.AppSettings["Connection_String"];
            //SqlConnection connection = new SqlConnection(connString);
            //SqlCommand command = new SqlCommand("select i_menu_id from TXN_USER_ACCESS where SZ_USER_ROLE_ID = '" + ddlUserRole.SelectedValue + "'", connection);
            //SqlDataAdapter adapter = new SqlDataAdapter(command);


            objBillSysMenu = new Bill_Sys_Menu();
            DataSet ChildMenuTable = new DataSet();
            ChildMenuTable = objBillSysMenu.GetSelectedMenu(ddlUserRole.SelectedValue);
            // adapter.Fill(ChildMenuTable);
            if (ChildMenuTable.Tables.Count > 0)
            {
                foreach (DataRow row in ChildMenuTable.Tables[0].Rows)
                {
                    String menuid = row["i_menu_id"].ToString();

                    foreach (TreeNode treenode in tvwmenu.Nodes[0].ChildNodes)
                    {
                        if (treenode.ChildNodes.Count > 0)
                        {
                            TreeNode parentTreenode  = new TreeNode();
                            TreeNode _parentTreenode = new TreeNode();
                            parentTreenode = treenode;
                            Boolean status = false;
                            int     st     = 1;
sa:
                            foreach (TreeNode childTreenode in parentTreenode.ChildNodes)
                            {
                                if (childTreenode.Value == menuid)
                                {
                                    status = false;
                                    childTreenode.Checked = true;
                                    break;
                                }
                                if (childTreenode.ChildNodes.Count > 0)
                                {
                                    status          = true;
                                    _parentTreenode = parentTreenode;
                                    parentTreenode  = childTreenode;
                                    goto sa;
                                }

                                if (status == true && parentTreenode.ChildNodes.Count == st)
                                {
                                    status         = false;
                                    parentTreenode = _parentTreenode;

                                    childTreenode.Parent.Checked = true;
                                }
                                st = st + 1;
                            }
                        }

                        if (treenode.Value == menuid)
                        {
                            treenode.Checked = true;
                            break;
                        }
                    }
                }
            }
        }
        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());
        }
    }