Exemplo n.º 1
0
 private void Clearer()
 {
     NameTextEdit.Text        = "";
     TypeTextEdit.Text        = null;
     DetailMemoEdit.EditValue = "";
     CandidateClearanceCheckListBoxCon.UnCheckAll();
     VoterClearanceCheckedListBoxCon.UnCheckAll();
 }
Exemplo n.º 2
0
        private void LoadCombo()
        {
            string msgs = "";

            gbl1.ComboItems = gbl1.GetCombo(ref msgs);
            //attempt to add all
            //will fail if dupplicate
            foreach (var item in gbl1.ComboItems)
            {
                CandidateClearanceVm obj = new CandidateClearanceVm();
                obj.GradeId    = item.Id;
                obj.PositionId = id;

                cbl.AddOne(obj, ref msgs);
            }

            //retieve the candidate clearances
            msgs = "";
            cbl.VmParams.PositionId = id;
            cbl.ListVm = cbl.GetList(cbl.VmParams, ref msgs);

            //make the candidate clearances as the datasource
            CandidateClearanceCheckListBoxCon.DataSource    = cbl.ListVm;
            CandidateClearanceCheckListBoxCon.DisplayMember = "Grade";
            CandidateClearanceCheckListBoxCon.ValueMember   = "Id";


            //set each items checked if active
            for (int i = 0; i < cbl.ListVm.Count; i++)
            {
                CandidateClearanceCheckListBoxCon.SetItemChecked(i, cbl.ListVm[i].Active);
            }



            gbl2.ComboItems = gbl2.GetCombo(ref msgs);
            //attempt to add all
            //will fail if dupplicate
            foreach (var item in gbl2.ComboItems)
            {
                VoterClearanceVm obj = new VoterClearanceVm();
                obj.GradeId    = item.Id;
                obj.PositionId = id;

                vbl.AddOne(obj, ref msgs);
            }

            //retieve the voter clearances
            msgs = "";
            vbl.VmParams.PositionId = id;
            vbl.ListVm = vbl.GetList(vbl.VmParams, ref msgs);

            //make the voter clearances as the datasource
            VoterClearanceCheckedListBoxCon.DataSource    = vbl.ListVm;
            VoterClearanceCheckedListBoxCon.DisplayMember = "Grade";
            VoterClearanceCheckedListBoxCon.ValueMember   = "Id";

            //set each items checked if active
            for (int i = 0; i < vbl.ListVm.Count; i++)
            {
                VoterClearanceCheckedListBoxCon.SetItemChecked(i, vbl.ListVm[i].Active);
            }
        }