예제 #1
0
        protected void linkSelectClick(object sender, EventArgs e)
        {
            OracleConnection conn = new OracleConnection(strConnString);

            conn.Open();
            int USER_DATA_ID = Convert.ToInt32(DropDownUserID.SelectedValue);

            DataTable dtUserPageID = new DataTable();
            DataSet   dsp          = new DataSet();
            string    makePageSQL  = " SELECT NDIU.DASH_ITEM_ID, NDIU.ORDER_BY ||' - '|| NDI.ITEM_NAME AS ITEM_NAME, NDIU.USER_ID, HEDIV.DIV_BG_COLOR, NDIU.ORDER_BY FROM NRC_DASHBOARD_ITEMS_USER NDIU LEFT JOIN NRC_DASHBOARD_ITEMS NDI ON NDI.DASH_ITEM_ID = NDIU.DASH_ITEM_ID  LEFT JOIN HR_EMP_DIVISIONS HEDIV ON HEDIV.DIVISION_ID  =  NDI.DIVISION_ID WHERE  NDIU.USER_ID  = '" + USER_DATA_ID + "' AND NDI.IS_ACTIVE = 'Enable' ORDER BY NDIU.ORDER_BY ";

            dsp          = ExecuteBySqlString(makePageSQL);
            dtUserPageID = (DataTable)dsp.Tables[0];
            DropDownUserItemID.DataSource     = dtUserPageID;
            DropDownUserItemID.DataValueField = "DASH_ITEM_ID";
            DropDownUserItemID.DataTextField  = "ITEM_NAME";
            DropDownUserItemID.DataBind();
            DropDownUserItemID.Items.Insert(0, new ListItem("Select Dashboard Item", "0"));

            //   dt = new DataTable();
            oradata.Fill(dtUserPageID);
            GridView1.DataSource   = dtUserPageID;
            GridView1.DataKeyNames = new string[] { "DASH_ITEM_ID" };
            GridView1.DataBind();

            conn.Close();
            TextOrderBy.Text  = "";
            alert_box.Visible = false;
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["USER_NAME"] != null)
            {
                string           requestedFile = Path.GetFileName(Request.Path);
                OracleConnection conn          = new OracleConnection(strConnString);
                conn.Open();
                string makeSQL = " SELECT  NUPP.IS_PAGE_ACTIVE, NUPP.IS_ADD_ACTIVE, NUPP.IS_EDIT_ACTIVE, NUPP.IS_DELETE_ACTIVE, NUPP.IS_VIEW_ACTIVE FROM NRC_USER_PAGE_PERMISSION NUPP LEFT JOIN NRC_USER_PAGES NUP ON NUP.USER_PAGE_ID = NUPP.USER_PAGE_ID  WHERE NUPP.USER_ID = '" + Session["USER_ID"] + "' AND NUP.IS_ACTIVE = 'Enable' AND NUP.PAGE_URL = '" + requestedFile + "' ";
                cmdl    = new OracleCommand(makeSQL);
                oradata = new OracleDataAdapter(cmdl.CommandText, conn);
                dt      = new DataTable();
                oradata.Fill(dt);
                RowCount = dt.Rows.Count;

                for (int i = 0; i < RowCount; i++)
                {
                    IS_PAGE_ACTIVE   = dt.Rows[i]["IS_PAGE_ACTIVE"].ToString();
                    IS_ADD_ACTIVE    = dt.Rows[i]["IS_ADD_ACTIVE"].ToString();
                    IS_EDIT_ACTIVE   = dt.Rows[i]["IS_EDIT_ACTIVE"].ToString();
                    IS_DELETE_ACTIVE = dt.Rows[i]["IS_DELETE_ACTIVE"].ToString();
                    IS_VIEW_ACTIVE   = dt.Rows[i]["IS_VIEW_ACTIVE"].ToString();
                }

                if (IS_PAGE_ACTIVE == "Enable")
                {
                    if (!IsPostBack)
                    {
                        DataTable dtUserID    = new DataTable();
                        DataSet   dsu         = new DataSet();
                        string    makeUserSQL = " select NU.USER_ID, NU.EMP_ID || ' - ' || HE.EMP_FNAME || ' ' || HE.EMP_LNAME || ' - ' || NUR.USER_ROLE_NAME AS EMP_NAME, NUR.USER_ROLE_NAME, NUR.UR_BG_COLOR from NRC_USER NU left join HR_EMPLOYEES HE ON HE.EMP_ID = NU.EMP_ID left join NRC_USER_ROLE  NUR ON NUR.USER_ROLE_ID =  NU.USER_ROLE_ID WHERE NU.IS_ACTIVE = 'Enable' ORDER BY  NU.EMP_ID ASC";
                        dsu      = ExecuteBySql(makeUserSQL);
                        dtUserID = (DataTable)dsu.Tables[0];
                        DropDownUserID.DataSource     = dtUserID;
                        DropDownUserID.DataValueField = "USER_ID";
                        DropDownUserID.DataTextField  = "EMP_NAME";
                        DropDownUserID.DataBind();
                        DropDownUserID.Items.Insert(0, new ListItem("Select User", "0"));


                        DataTable dtUserPageID = new DataTable();
                        DataSet   dsp          = new DataSet();
                        string    makePageSQL  = " SELECT DASH_ITEM_ID, ITEM_NAME FROM NRC_DASHBOARD_ITEMS NDI  WHERE NDI.IS_ACTIVE = 'Enable' ";
                        dsp          = ExecuteBySql(makePageSQL);
                        dtUserPageID = (DataTable)dsp.Tables[0];
                        DropDownUserItemID.DataSource     = dtUserPageID;
                        DropDownUserItemID.DataValueField = "DASH_ITEM_ID";
                        DropDownUserItemID.DataTextField  = "ITEM_NAME";
                        DropDownUserItemID.DataBind();


                        Display();

                        alert_box.Visible = false;
                    }
                    IsLoad = false;
                }
                else
                {
                    Response.Redirect("~/PagePermissionError.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }
        }