예제 #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();

                    //PenjaminanDataset.DivisiRow dr = m_divisi.selectDivisiByID(Convert.ToInt16(DropDownList1.Text));
                }
                else if (eType == "delete")
                {
                    softDeleteData(eID);
                }
            }

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

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

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

                if (eType == "edit")
                {
                    PenjaminanDataset.KaryawanRow dr = Karyawan.selectKaryawanByID(eID);
                    tDivisiID = dr.DivisiID;
                    DropDownList1.SelectedValue = tDivisiID.ToString();
                }

                //DropDownList1.DataTextFormatString = "{0} - {1}";
                //DropDownList1.DataTextField = "ID,NamaDivisi";
            }
        }
예제 #3
0
        private void BindData()
        {
            Models.PenjaminanDatasetTableAdapters.DivisiTableAdapter ta = new Models.PenjaminanDatasetTableAdapters.DivisiTableAdapter();

            Session["divisiDt"] = (PenjaminanDataset.DivisiDataTable)ta.GetData();
        }