Ejemplo n.º 1
0
    protected void btnGenerate_Click(object sender, EventArgs e)
    {
        SysJobAccessDAL _dal = new SysJobAccessDAL();
        Hashtable       _ht  = new Hashtable();

        try
        {
            _ht["p_usergroup"] = txtUSERGROUP.Text;
            Utility.ApplyDefaultProp(_ht);
            _dal.Generate(_ht);
            BindTblDocument();
        }
        catch (Exception ex)
        {
        }
    }
Ejemplo n.º 2
0
    private void SaveData()
    {
        MasterUserDAL   _dalMasterUser = null;
        SysJobAccessDAL _dalJobAccess  = null;
        Hashtable       _htParameters  = null;

        try
        {
            _dalMasterUser = new MasterUserDAL();
            _htParameters  = new Hashtable();

            MPF23.Shared.Mapper.UIToDB.Map(pnlBody.Controls, _htParameters);
            Utility.ApplyDefaultProp(_htParameters);

            if (chkIsActive.Checked == true)
            {
                _htParameters["p_is_active_flag"] = "1";
            }
            else
            {
                _htParameters["p_is_active_flag"] = "0";
            }

            if (Request.Params["action"] == "add")
            {
                _dalMasterUser.Insert(_htParameters);
            }
            else
            {
                _htParameters["p_user_id"]      = Request.Params["id"];
                _htParameters["p_user_id_baru"] = txtUSER_ID.Text;
                _dalMasterUser.UpdateLoginInfo(_htParameters);
            }
            _dalJobAccess = new SysJobAccessDAL();



            Utility.ShowMessageBox(this, Utility.SAVE_DATA_SUCCESS_MESSAGE, null, "userdetail.aspx?action=edt&id=" + txtUSER_ID.Text);
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.SAVE_DATA_FAIL_MESSAGE, ex, null);
        }
    }
Ejemplo n.º 3
0
    private void BindTblDocument()
    {
        MenuDAL         _dalMenu      = null;
        SysJobAccessDAL _dalJobAccess = null;
        Hashtable       _htParameters = null;
        DataTable       _dtParent     = null;
        DataTable       _dtChild      = null;
        DataTable       _dt           = null;

        try
        {
            _dalMenu      = new MenuDAL();
            _dalJobAccess = new SysJobAccessDAL();
            _htParameters = new Hashtable();

            _htParameters["p_usergroupid"] = Request.Params["id"];
            _htParameters["p_menu_id"]     = "1";
            _htParameters["p_usergroup"]   = txtUSERGROUP.Text;
            _htParameters["p_keywords"]    = "";
            _dt = _dalJobAccess.GetRows(_htParameters);
            _dt.Rows.Clear();

            //get parent
            _htParameters["p_module_id"]      = 1;
            _htParameters["p_parent_menu_id"] = DBNull.Value;
            _dtParent = _dalMenu.GetRows(_htParameters);

            foreach (DataRow _drParent in _dtParent.Rows)
            {
                //sRetValue = sRetValue + @"<h3><a href='#'>" + _drParent["MENU_NAME"].ToString() + "</a></h3><div style='padding:2px'><p><ul>";
                _htParameters["p_usergroupid"] = Request.Params["id"];
                _htParameters["p_menu_id"]     = _drParent["MENU_ID"];
                _htParameters["p_usergroup"]   = txtUSERGROUP.Text;
                _htParameters["p_keywords"]    = "";
                try
                {
                    _dt.ImportRow((_dalJobAccess.GetRowByMenuId(_htParameters)).Rows[0]);

                    _htParameters["p_module_id"]      = 1;
                    _htParameters["p_parent_menu_id"] = (int)_drParent["MENU_ID"];

                    _dtChild = _dalMenu.GetRows(_htParameters);

                    foreach (DataRow _drChild in _dtChild.Rows)
                    {
                        _htParameters["p_usergroupid"] = Request.Params["id"];
                        _htParameters["p_menu_id"]     = _drChild["MENU_ID"];
                        _htParameters["p_usergroup"]   = txtUSERGROUP.Text;
                        _htParameters["p_keywords"]    = txtSearch.Text;

                        try
                        {
                            _dt.ImportRow((_dalJobAccess.GetRowByMenuId(_htParameters)).Rows[0]);
                        }
                        catch (Exception)
                        {
                        }
                    }
                }
                catch (Exception)
                {
                }
                //sRetValue = sRetValue + "</ul></p></div>";
            }
            gvwList.DataSource = _dt;
            gvwList.DataBind();
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }