Example #1
0
        public bool PersonCreating_UpdateGUI()
        {
            ClearForm();
            txt_Code.Focus();
            popup_PersonCreate.ShowOnPageLoad    = true;
            popup_PersonCreate.HeaderText        = "Thông Tin Người Dùng";
            ASPxGridView_LoginAccount.DataSource = Temp_LoginAccount;
            ASPxGridView_LoginAccount.DataBind();
            ASPxTreeList_OfDepartment.DataBind();
            ASPxGridView_LoginAccount.AddNewRow();

            return(true);
        }
Example #2
0
        public bool PersonEditing_UpdateGUI()
        {
            ClearForm();
            // Load Person
            Person person = session.GetObjectByKey <Person>(PersonId);

            frmPersonEdit.DataSource = person;
            frmPersonEdit.DataBind();

            // load TMP_LOGINACCOUNT
            var selectedLA = from la in person.LoginAccounts where la.RowStatus > 0 select la;

            foreach (LoginAccount la in selectedLA)
            {
                Temp_LoginAccount.Add(new TMPLoginAccount()
                {
                    LoginAccountId = la.LoginAccountId,
                    Email          = la.Email
                });
            }
            ASPxGridView_LoginAccount.DataSource = Temp_LoginAccount;
            ASPxGridView_LoginAccount.DataBind();

            // Bind selected Node
            var selectedDP = from dp in person.DepartmentPersons where dp.RowStatus > 0 select dp;

            foreach (DepartmentPerson dp in selectedDP)
            {
                foreach (TreeListNode node in DepartmentNodes)
                {
                    if (Guid.Parse(node.Key).Equals(dp.DepartmentId.DepartmentId))
                    {
                        node.Selected = true;
                    }
                }
            }
            ASPxTreeList_OfDepartment.DataBind();

            // UPDATE GUI
            popup_PersonCreate.ShowOnPageLoad = true;
            popup_PersonCreate.HeaderText     = string.Format("Thông Tin Người Dùng: {0}", person.Name);
            return(true);
        }