コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserProfile"] == null)
            {
                Response.Redirect("/Default.aspx");
            }
            if (!Page.IsPostBack)
            {
                if (eType == "add")
                {
                }
                else if (eType == "edit")
                {
                    bindData();
                }
                else if (eType == "delete")
                {
                    softDeleteData(eID);
                }
            }

            lblMenu.Text          = "Entry Master User";
            Session["activepage"] = "user";

            if (!Page.IsPostBack)
            {
                Models.PenjaminanDatasetTableAdapters.DivisiTableAdapter ta     = new Models.PenjaminanDatasetTableAdapters.DivisiTableAdapter();
                Models.PenjaminanDatasetTableAdapters.u_roleTableAdapter taRole = new Models.PenjaminanDatasetTableAdapters.u_roleTableAdapter();

                DropDownList1.DataSource = (PenjaminanDataset.DivisiDataTable)ta.GetData();
                DropDownList1.DataBind();

                RoleList.DataSource = (PenjaminanDataset.u_roleDataTable)taRole.GetData();
                RoleList.DataBind();

                //set jadi kosong ketika add new


                if (eType == "edit")
                {
                    PenjaminanDataset.UserProfileRow dr = UserProfile.selectUserProfileByID(eID);
                    tDivisiID = Convert.ToInt16(dr.division);
                    tRoleID   = Convert.ToInt16(dr.role);

                    DropDownList1.SelectedValue = tDivisiID.ToString();
                    RoleList.SelectedValue      = tRoleID.ToString();
                }
                //else if(eType == "add")
                //{
                //    DropDownList1.SelectedValue = " ";
                //    RoleList.SelectedValue = " ";
                //}

                //DropDownList1.DataTextFormatString = "{0} - {1}";
                //DropDownList1.DataTextField = "ID,NamaDivisi";
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserProfile"] == null)
            {
                Response.Redirect("/Default.aspx");
            }
            if (!Page.IsPostBack)
            {
                if (eType == "add")
                {
                }
                else if (eType == "edit")
                {
                    bindData();
                }
                else if (eType == "delete")
                {
                    softDeleteData(eID);
                }
            }

            lblMenu.Text          = "Entry Master Access";
            Session["activepage"] = "Access";

            if (!Page.IsPostBack)
            {
                Models.PenjaminanDatasetTableAdapters.tPageTableAdapter  ta     = new Models.PenjaminanDatasetTableAdapters.tPageTableAdapter();
                Models.PenjaminanDatasetTableAdapters.u_roleTableAdapter taRole = new Models.PenjaminanDatasetTableAdapters.u_roleTableAdapter();

                PageList.DataSource = (PenjaminanDataset.tPageDataTable)ta.GetData();
                PageList.DataBind();

                RoleList.DataSource = (PenjaminanDataset.u_roleDataTable)taRole.GetData();
                RoleList.DataBind();

                if (eType == "edit")
                {
                    PenjaminanViewDataset.AccessRow dr = Access.selectAccessByID(eID);
                    tPageID = Convert.ToInt16(dr.fk_page);
                    tRoleID = Convert.ToInt16(dr.fk_role);

                    PageList.SelectedValue = tPageID.ToString();
                    RoleList.SelectedValue = tRoleID.ToString();
                }
            }
        }
コード例 #3
0
ファイル: ViewRole.aspx.cs プロジェクト: zikzik76/PROJECT-KBI
        private void BindData()
        {
            Models.PenjaminanDatasetTableAdapters.u_roleTableAdapter ta = new Models.PenjaminanDatasetTableAdapters.u_roleTableAdapter();

            Session["roleDt"] = (PenjaminanDataset.u_roleDataTable)ta.GetData();
        }