Ejemplo n.º 1
0
        private void chkLstChuaThanhToan_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            var item      = this.chkLstChuaThanhToan.Items[e.Index];
            var xetNghiem = (DTO.XetNghiemDTO)item.Value;

            this.tongChiPhiChuaThanhToan += e.State == CheckState.Unchecked ? -xetNghiem.ChiPhi : xetNghiem.ChiPhi;
            this.txtTongSoTien.Text       = this.tongChiPhiChuaThanhToan.ToString();

            var maHoSo      = this.hoso.MaHoSo;
            var maXetNghiem = xetNghiem.MaXetNghiem;


            if (e.State == CheckState.Checked)
            {
                var kqXN = this.bus.getKetQuaXetNghiem(maHoSo, maXetNghiem);
                this.danhSachChonThanhToan.Add(kqXN);
            }
            else
            {
                this.danhSachChonThanhToan.RemoveAll(kqxn => kqxn.MaHoSo.Equals(maHoSo) && kqxn.MaXetNghiem.Equals(maXetNghiem));
            }

            var existsChecked = this.chkLstChuaThanhToan.Items.ToList().FindAll(it => it.CheckState == CheckState.Checked).Count > 0;

            this.btnSave.Enabled = existsChecked;
        }
Ejemplo n.º 2
0
        private void cklRules_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            DataTable dtCklRules = cklRules.DataSource as DataTable;

            if (dtCklRules == null || dtCklRules.Rows.Count < 1)
            {
                return;
            }
            DataRow dr = dtCklRules.Rows[e.Index];

            if (e.State == CheckState.Checked)
            {
                if (!lst.ContainsValue(dr[EDC_ABNORMAL_FIELDS.FIELD_ABNORMALID].ToString()))
                {
                    lst.Add(dr[EDC_ABNORMAL_FIELDS.FIELD_ARULECODE].ToString(), dr[EDC_ABNORMAL_FIELDS.FIELD_ABNORMALID].ToString());
                }
            }
            else
            {
                if (!lst.ContainsValue(dr[EDC_ABNORMAL_FIELDS.FIELD_ABNORMALID].ToString()))
                {
                    lst.Remove(dr[EDC_ABNORMAL_FIELDS.FIELD_ARULECODE].ToString());
                }
            }
        }
Ejemplo n.º 3
0
 private void chkLamp1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     try
     {
         string outstr   = string.Empty;
         string outValue = string.Empty;
         for (int i = 0; i < chkLamp1.ItemCount; i++)
         {
             if (chkLamp1.GetItemCheckState(i) == CheckState.Checked)
             {
                 if (outstr != string.Empty)
                 {
                     outstr   += ",";
                     outValue += ",";
                 }
                 outstr   += chkLamp1.GetItemText(i).ToString();
                 outValue += chkLamp1.GetItemValue(i).ToString();
             }
         }
         drpLamp1.EditValue = outstr;
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Event which is fired when the
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void checkedListBoxControlDisplayOptions_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            if (checkedListBoxControlDisplayOptions.Items[0].CheckState == CheckState.Checked)
            {
                DisplayWishboneForces = true;
            }
            else
            {
                DisplayWishboneForces = false;
            }


            //DisplayWishboneDecomp = (bool)checkedListBoxControlDisplayOptions.Items[1].Value;
            //DisplayBearingCapForces = (bool)checkedListBoxControlDisplayOptions.Items[2].Value;
            //DisplaySuspendedMassForces = (bool)checkedListBoxControlDisplayOptions.Items[3].Value;
            //DisplayNonSuspendedMassForces = (bool)checkedListBoxControlDisplayOptions.Items[4].Value;

            ForcesToBeDisplayed.Clear();

            for (int i = 0; i < checkedListBoxControlDisplayOptions.Items.Count; i++)
            {
                if (checkedListBoxControlDisplayOptions.Items[i].CheckState == CheckState.Checked)
                {
                    ForcesToBeDisplayed.Add(checkedListBoxControlDisplayOptions.Items[i].Description);
                }
            }
        }
Ejemplo n.º 5
0
        private void check1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            //for (int i = 0; i < check1.CheckedItemsCount; i++)
            //{
            //    var a = check1.GetItemValue;
            //}
            textBox1.Text = string.Empty;
            StringBuilder sb   = new StringBuilder();
            var           tong = 0;

            foreach (var item in check1.CheckedItems)
            {
                tong = tong + 1;
                var max = check1.CheckedItemsCount;
                if (tong < max)
                {
                    sb.Append(item + "  =>  ");
                }
                else
                {
                    sb.Append(item);
                }
                //MessageBox.Show(sb.ToString());
            }
            textBox1.Text = sb.ToString();
        }
Ejemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ChkPopGridList_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     try
     {
         tempDisplayMember = "";
         tempEditValue     = "";
         for (int i = 0; i < m_chkPopList.ItemCount; i++)
         {
             if (m_chkPopList.GetItemCheckState(i) == CheckState.Checked)
             {
                 if (tempDisplayMember != string.Empty)
                 {
                     tempDisplayMember += ",";
                 }
                 if (tempEditValue != string.Empty)
                 {
                     tempEditValue += ",";
                 }
                 tempDisplayMember += m_chkPopList.GetItemText(i).ToString();
                 tempEditValue     += m_chkPopList.GetItemValue(i).ToString();
             }
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Ejemplo n.º 7
0
 private void lsLoaiCuocGoi_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     if (_checkChange)
     {
         return;
     }
     _checkChange = true;
     if (e.Index == 0)
     {
         if (e.State == CheckState.Checked)
         {
             for (int i = 1; i < lsLoaiCuocGoi.Items.Count; i++)
             {
                 lsLoaiCuocGoi.Items[i].CheckState = CheckState.Unchecked;
             }
         }
     }
     else
     {
         if (e.State == CheckState.Checked)
         {
             lsLoaiCuocGoi.Items[0].CheckState = CheckState.Unchecked;
         }
     }
     _checkChange = false;
 }
Ejemplo n.º 8
0
 //TODO : Remove this when log system is added
 /// <summary>
 /// Sets boolean to true that identifies that roll has been changed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 /// <remarks>Created: Werner Scheffer 28/02/2013</remarks>
 private void lstRoles_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     if (!Startup)
     {
         RollHasChanged = true;
     }
 }
Ejemplo n.º 9
0
        private void uxPermissionsListBox_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            if (_loading)
            {
                return;
            }

            if (looked)
            {
                //if (e.State == CheckState.Unchecked)
                //    uxPermissionsListBox.Items[e.Index].CheckState = CheckState.Checked;
                //else
                uxPermissionsListBox.Items[e.Index].InvertCheckState();
                //uxPermissionsListBox.Items[e.Index].CheckState = CheckState.Unchecked;
                return;
            }



            if (e.State == CheckState.Checked)
            {
                Secure Secure = uxPermissionsListBox.Items[e.Index].Value as Secure;
                WIN.BASEREUSE.Permission Permission = new WIN.BASEREUSE.Permission();
                Permission.FullMethodName = Secure.FullName;
                Permission.Profile        = _profile;
                _profile.Permissions.Add(Permission);
                SecureDataAccess.MarkNew(Permission);
            }
            else
            {
                Secure Secure = uxPermissionsListBox.Items[e.Index].Value as Secure;
                DeletePermission(Secure.FullName);
            }
        }
Ejemplo n.º 10
0
        //<checkedListBoxControl1>
        //-------------------------------------------------------------------------------------------------------------
        private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            bool   optionSet = e.State == CheckState.Checked ? true : false;
            string option    = checkedListBoxControl1.GetDisplayItemValue(e.Index).ToString();

            DevExpress.Utils.SetOptions.SetOptionValueByString(option, gridView1.OptionsView, optionSet);
        }
 private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     gvSiparis.FocusedRowChanged -= gvSiparis_FocusedRowChanged;
     Getir();
     gvSiparis.FocusedRowChanged += gvSiparis_FocusedRowChanged;
     gvSiparis_FocusedRowChanged(null, null);
 }
Ejemplo n.º 12
0
        private void checkedListBox1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            int sCount = checkedListBox1.CheckedItems.Count;

            lblCount.Text = sCount.ToString() + " Batches Selected";
            //if (e.State == CheckState.Checked) { ++sCount; }
            //if (e.State == CheckState.Unchecked) { --sCount; }
        }
Ejemplo n.º 13
0
 private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     //foreach (object item in checkedListBoxControl1.CheckedItems)
     //{
     //    DataRowView row = item as DataRowView;
     //    row["Checked"] = e.State == CheckState.Checked;
     //}
 }
Ejemplo n.º 14
0
        private void clGenre_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            BookCategory current = (BookCategory)bdsBookCategory[e.Index];
            string       genre   = current.Name;

            OnGenreSelected(genre);
            //e.Index
        }
Ejemplo n.º 15
0
        private void chcklist_cmdFr_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            try
            {
                if (e.State == CheckState.Checked)
                {
                    string    numCmd = (sender as DevExpress.XtraEditors.CheckedListBoxControl).SelectedValue.ToString();
                    DataTable dt     = CLIENT_APP_PARAM.gcws.GetDetailsCommandeFournisseurEnAttenteLivraison(numCmd);
                    foreach (DataRow dr in dt.Rows)
                    {
                        _bs_details_br.AddNew();
                        DataRowView drv = (DataRowView)_bs_details_br.Current;
                        drv["CODE_BRECEP"]         = _CODE_BRECEP;
                        drv["CODE_BR_FR"]          = "";
                        drv["CODE_ARTICLE"]        = dr["CODE_ARTICLE"];
                        drv["REF_ARTICLE"]         = dr["REF_ARTICLE"];
                        drv["DESIGNATION_ARTICLE"] = dr["DESIGNATION_ARTICLE"];
                        drv["QTE_LG_BR_FR"]        = (decimal)dr["QTE"] - (decimal)dr["QTE_LIVREE"];
                        drv["PRIX_ART_BR_FR"]      = dr["PRIX_HT"];
                        drv["UNITE"]        = dr["UNITE"];
                        drv["TVA"]          = dr["TAUX_TVA"];
                        drv["REMISE"]       = dr["REMISE"];
                        drv["FODEC"]        = dr["FODEC"];
                        drv["CODE_CMD_FR"]  = dr["CODE_COMMANDE_FOURNISSEUR"];
                        drv["CODE_FACT_FR"] = "";
                        _bs_details_br.EndEdit();
                        (_bs_details_br.DataSource as DataTable).AcceptChanges();
                        textBox2.Focus();
                        textBox2.Select();
                        panel_qte.Visible = false;
                    }
                }
                else
                {
                    string    numCmd = (sender as DevExpress.XtraEditors.CheckedListBoxControl).SelectedValue.ToString();
                    DataTable dt     = CLIENT_APP_PARAM.gcws.GetDetailsCommandeFournisseurEnAttenteLivraison(numCmd);

                    foreach (DataRow dr in dt.Rows)
                    {
                        foreach (DataRow drsource in dS_MOUV1.LG_BR_FR.Rows)
                        {
                            if (drsource["CODE_CMD_FR"].ToString() == dr["CODE_COMMANDE_FOURNISSEUR"].ToString() && drsource["CODE_ARTICLE"].ToString() == dr["CODE_ARTICLE"].ToString())
                            {
                                dS_MOUV1.LG_BR_FR.Rows.Remove(drsource);
                                dS_MOUV1.LG_BR_FR.AcceptChanges();
                                break;
                            }
                        }
                    }
                }

                calculer_montant();
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message, this.Text);
            }
        }
Ejemplo n.º 16
0
 private void checkedListBox_DeptType_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     if (e.State == CheckState.Checked && checkedListBox_DeptType.CheckedItems.Count > 1)
     {
         checkedListBox_DeptType.ItemCheck -= checkedListBox_DeptType_ItemCheck;
         checkedListBox_DeptType.SetItemChecked(checkedListBox_DeptType.CheckedIndices[0], false);
         checkedListBox_DeptType.ItemCheck += checkedListBox_DeptType_ItemCheck;
     }
 }
 void nameColumnFilter_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     if (nameColumnFilter.CheckedItems.Count == 0)
     {
         gridView1.Columns["Name"].ClearFilter();
         return;
     }
     AddColumnFilter("Name", nameColumnFilter);
 }
 void categoryColumnFilter_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     if (categoryColumnFilter.CheckedItems.Count == 0)
     {
         gridView1.Columns["Category"].ClearFilter();
         return;
     }
     AddColumnFilter("Category", categoryColumnFilter);
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 设置左侧列表只能单选
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void clbc_workflow_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     for (int i = 0; i < clbc_workflow.ItemCount; i++)
     {
         if (i != e.Index)
         {
             clbc_workflow.SetItemCheckState(i, CheckState.Unchecked);
         }
     }
 }
        private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            if (lockItemCheck)
            {
                return;
            }
            DataRowView row = dataTable1.DefaultView[e.Index];

            row["Checked"] = e.State == CheckState.Checked;
        }
Ejemplo n.º 21
0
        private void chbx_BR_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            try
            {
                if (e.State == CheckState.Checked)
                {
                    decimal   CODE_BRECEP = (decimal)(sender as DevExpress.XtraEditors.CheckedListBoxControl).SelectedValue;
                    DataTable dt          = CLIENT_APP_PARAM.gcws.SELECT_DETAILS_BR_FR_SansFactures(CODE_BRECEP);
                    foreach (DataRow dr in dt.Rows)
                    {
                        bsDetails.AddNew();
                        DataRowView drv = (DataRowView)bsDetails.Current;
                        drv["CODE_BR_FR"]          = dr["CODE_BRECEP"];
                        drv["CODE_ARTICLE"]        = dr["CODE_ARTICLE"];
                        drv["REF_ARTICLE"]         = dr["REF_ARTICLE"];
                        drv["DESIGNATION_ARTICLE"] = dr["DESIGNATION_ARTICLE"];
                        drv["QTE"]      = (decimal)dr["QTE"];
                        drv["PRIX_HT"]  = dr["PRIX_ART_BR_FR"];
                        drv["UNITE"]    = dr["UNITE"];
                        drv["TAUX_TVA"] = dr["TVA"];
                        drv["REMISE"]   = dr["REMISE"];
                        drv["FODEC"]    = dr["FODEC"];
                        drv["CODE_FACTURE_FOURNISSEUR"] = "";
                        drv["CODE_CMD_FR"] = dr["CODE_CMD_FR"];
                        drv["CODE_BR"]     = dr["CODE_BR_FR"];
                        bsDetails.EndEdit();
                        (bsDetails.DataSource as DataTable).AcceptChanges();
                    }
                }
                else
                {
                    decimal   CODE_BRECEP = (decimal)(sender as DevExpress.XtraEditors.CheckedListBoxControl).SelectedValue;
                    DataTable dt          = CLIENT_APP_PARAM.gcws.SELECT_DETAILS_BR_FR_SansFactures(CODE_BRECEP);

                    foreach (DataRow dr in dt.Rows)
                    {
                        foreach (DataRow drsource in dS_MOUV1.V_LG_FACT_FR.Rows)
                        {
                            if (drsource["CODE_BR_FR"].ToString() == dr["CODE_BRECEP"].ToString() && drsource["CODE_ARTICLE"].ToString() == dr["CODE_ARTICLE"].ToString())
                            {
                                dS_MOUV1.V_LG_FACT_FR.Rows.Remove(drsource);
                                dS_MOUV1.V_LG_FACT_FR.AcceptChanges();
                                break;
                            }
                        }
                    }
                }

                calculer_montant();
            }
            catch (Exception er)
            {
                MessageBox.Show(er.Message, this.Text);
            }
        }
Ejemplo n.º 22
0
 private void ChkList_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     try
     {
         lstLista.FirstOrDefault(a => a.Name == this.chkList.Items[e.Index].Tag.ToString()).Visible = (e.State == CheckState.Checked) ? true : false;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Ejemplo n.º 23
0
 private void ckbP_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     try
     {
         LoadTotal();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 24
0
 void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     if (e.State == CheckState.Checked)
     {
         PopulateGrid(e.Index);
     }
     else if (e.State == CheckState.Unchecked)
     {
         RemoveDataRowsFromDataTable(e.Index);
     }
 }
Ejemplo n.º 25
0
        private void rChListTask_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            var stateSQL           = rChListTask.GetItemChecked(0);
            var itemDlls           = rChListTask.GetItemChecked(1);
            var itemDllsITE        = rChListTask.GetItemChecked(2);
            var itemDllsITSolution = rChListTask.GetItemChecked(3);

            pnlSql.Visible = stateSQL;

            var index = rChListTask.SelectedIndex;

            switch (index)
            {
            //DLLs
            case 1:
                rChListTask.SetItemChecked(2, false);
                rChListTask.SetItemChecked(3, false);
                break;

            //DLLs ITE
            case 2:

                if (itemDlls && itemDllsITSolution)
                {
                    rChListTask.SetItemChecked(1, false);
                    rChListTask.SetItemChecked(3, false);
                }
                else if (itemDlls)
                {
                    rChListTask.SetItemChecked(1, false);
                }
                break;

            //DLLs ITSolution
            case 3:
                if (itemDlls && itemDllsITE)
                {
                    rChListTask.SetItemChecked(1, false);
                    rChListTask.SetItemChecked(2, false);
                }
                else if (itemDlls)
                {
                    rChListTask.SetItemChecked(1, false);
                }
                break;
            }

            /*
             *  if (item.CheckState == CheckState.Checked)
             *      item.CheckState = CheckState.Unchecked;
             *  else
             *      item.CheckState = CheckState.Checked;
             */
        }
Ejemplo n.º 26
0
        private void cboxListForderSVG_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            try
            {
                if (group2[e.Index] == null)
                {
                    group2[e.Index] = new GalleryItemGroup();
                }
                if (e.State == CheckState.Checked)
                {
                    string SelectedPath = ReadKey("Symbols") + $@"\\{ cboxListForderSVG.SelectedItem.ToString()}";

                    var         dirs        = DirSearch(SelectedPath).ToArray();
                    SvgDocument svgDocument = null;
                    foreach (var item in dirs)
                    {
                        string newName = Path.GetFileNameWithoutExtension(item);
                        try
                        {
                            svgDocument = SvgDocument.Open(item);
                            var bitmap = svgDocument.Draw();

                            group2[e.Index].Items?.Add(new GalleryItem(bitmap, newName, item));
                            Application.DoEvents();
                            svgDocument = null;
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                    }
                    gcSVG.Gallery.ItemImageLayout = ImageLayoutMode.ZoomInside;
                    gcSVG.Gallery.ImageSize       = new Size(70, 70);
                    // gcSVG.Gallery.ShowItemText = true;

                    group2[e.Index].Caption = cboxListForderSVG.SelectedItem.ToString();
                    gc.Gallery.BeginUpdate();
                    gcSVG.Gallery.Groups.Add(group2[e.Index]);
                    gc.Gallery.EndUpdate();
                }
                else
                {
                    if (group2[e.Index].Items.Count > 0)
                    {
                        gcSVG.Gallery.Groups?.Remove(group2[e.Index]);
                    }
                    group2[e.Index] = null;
                }
            }
            catch (Exception ex)
            {
                EventscadaException?.Invoke(this.GetType().Name, ex.Message);
            }
        }
Ejemplo n.º 27
0
 private void checkValue_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (e.State == CheckState.Checked)
     {
         value.SetFlag(e.Index + 1, true);
     }
     else
     {
         value.SetFlag(e.Index + 1, false);
     }
 }
Ejemplo n.º 28
0
 private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     if (checkedListBoxControl1.CheckedItemsCount > 0)
     {
         eliminarButton.Enabled = true;
     }
     else
     {
         eliminarButton.Enabled = false;
     }
 }
Ejemplo n.º 29
0
 private void checkedListBoxControl1_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
 {
     if (e.State == CheckState.Checked && flag)
     {
         flag = false;
         checkedListBoxControl1.BeginUpdate();
         checkedListBoxControl1.UnCheckAll();
         checkedListBoxControl1.SetItemChecked(e.Index, true);
         checkedListBoxControl1.EndUpdate();
         flag = true;
     }
 }
Ejemplo n.º 30
0
        private void checkListXetNghiem_ItemCheck(object sender, DevExpress.XtraEditors.Controls.ItemCheckEventArgs e)
        {
            var item      = this.checkListXetNghiem.Items[e.Index];
            var xetNghiem = (DTO.XetNghiemDTO)item.Value;
            var chiphi    = e.State == CheckState.Unchecked ? -xetNghiem.ChiPhi : xetNghiem.ChiPhi;

            this.totalCharge += chiphi;

            var existsCheckedItem = this.checkListXetNghiem.Items.ToList().FindAll(i => i.CheckState == CheckState.Checked).Count > 0;

            this.btnAssign.Enabled = existsCheckedItem;
        }
 private void checkedComboBoxManagementAgencyActivity_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (_isManualSelect)
     {
         int maaId = (int)this.checkedComboBoxManagementAgencyActivity.Properties.Items[e.Index].Value;
         var maa = ((List<management_agency_activity>) this.managementAgencyActivityBindingSource.List)
             .Find(x => x.management_agency_activity_id == maaId);
         if (e.State == CheckState.Checked)
         {
             if (!_edu.management_agency_activity.Contains(maa))
                 _edu.management_agency_activity.Add(maa);
         }
         else
         {
             if (_edu.management_agency_activity.Contains(maa))
                 _edu.management_agency_activity.Remove(maa);
         }
     }
 }
 private void checkedComboBoxActivityType_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (_isManualSelect)
     {
         int atId = (int)this.checkedComboBoxActivityType.Properties.Items[e.Index].Value;
         var at = ((List<activity_type>) this.activityTypeBindingSource.List)
             .Find(x => x.activity_type_id == atId);
         if (e.State == CheckState.Checked)
         {
             if (!_edu.activity_type.Contains(at))
                 _edu.activity_type.Add(at);
         }
         else
         {
             if (_edu.activity_type.Contains(at))
                 _edu.activity_type.Remove(at);
         }
     }
 }
 private void checkedListBoxEduKinds_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (_isManualChecking)
     {
         var kind = (edu_kind) this.checkedListBoxEduKinds.GetItem(e.Index);
         var form = (form) this.formBindingSource.Current;
         switch (e.State)
         {
             case CheckState.Checked:
                 if (!form.edu_kind.Contains(kind))
                 {
                     form.edu_kind.Add(kind);
                     eduBindingSource.DataSource = eduBindingSource.List.Cast<edu>().Union(kind.edus).ToList();
                     SelectBlockedEdus(form.blocked_edus);
                 }
                 break;
             case CheckState.Unchecked:
                 if (form.edu_kind.Contains(kind))
                 {
                     form.edu_kind.Remove(kind);
                     eduBindingSource.DataSource = eduBindingSource.List.Cast<edu>().Except(kind.edus).ToList();
                     form.blocked_edus = new HashSet<edu>(form.blocked_edus.Except(kind.edus));
                     SelectBlockedEdus(form.blocked_edus);
                 }
                 break;
         }
         if (!_editedList.Contains(form))
             _editedList.Add(form);
     }
 }
Ejemplo n.º 34
0
 private void CheckedListBoxItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (e.Index != 0)
     {
         return;
     }
     var checkState = Items[e.Index].CheckState;
     for (var i = 1; i < Items.Count; i++)
     {
         Items[i].CheckState = checkState;
     }
 }
        private void ListBoxQueriesOnItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (!_isManualChecking) return;
            var listBoxControl = (CheckedListBoxControl) sender;
            if (listBoxControl != null)
            {
                var checkedItem = listBoxControl.GetItemValue(e.Index);
                if (!(checkedItem is query))
                {
                    for (int i = 0; i < listBoxControl.ItemCount; i++)
                    {
                        var item = listBoxControl.GetItemValue(i) as query;
                        if (item == null)
                            continue;
                        var args = new SelectionChangedEventArgs(
                            e.State == CheckState.Checked
                                ? CollectionChangeAction.Add
                                : CollectionChangeAction.Remove, _queryList.IndexOf(item));
                        OnSelectionChanged(args);
                    }
                }
                else
                {
                    var query = checkedItem as query;
                    if (e.State == CheckState.Checked)
                        _selectedQueryList.Add(query);
                    else
                        _selectedQueryList.Remove(query);

                    var eventArgs = new SelectionChangedEventArgs(
                        e.State == CheckState.Checked
                            ? CollectionChangeAction.Add
                            : CollectionChangeAction.Remove, _queryList.IndexOf(query));
                    OnSelectionChanged(eventArgs);
                }
            }
        }