Esempio n. 1
0
 private void AddItem()  //Agrego un item
 {
     if (List)
     {     //Si la lista existe procedo
         if (TxtItem.Text != "")
         { //Si hay algo para ingresar lo ingreso a la lista
             String Item;
             Item = TxtItem.Text;
             StringList.Add(Item);
             LoadList();
             CmbItem.AddItem(Item);
             TxtItem.Text = "";
             BttnList.Focus();
             ItemsCount++;
             LblItems.Text = "CANTIDAD DE ITEMS: " + ItemsCount;
         }
         else
         {//Si no hay nada que ingresar aviso que hay un campo sin completar
             LblErrorAdd.Text    = "*CAMPO VACÍO";
             LblErrorAdd.Visible = true;
         }
     }
     else
     {//Si no se ha creado la lista lo digo
         LblErrorAdd.Text    = "*NO EXISTE UNA LISTA";
         LblErrorAdd.Visible = true;
     }
 }
Esempio n. 2
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (List)  //Si la lista ha sido creada procedo
     {
         if (CmbItem.selectedIndex != -1 && CmbItem.selectedValue != "")
         {//si se ha seleccionado algo en el combobox lo elimino de la lista
             if (LblErrorDelete.Visible)
             {
                 LblErrorDelete.Visible = false;
             }
             StringList.Remove(CmbItem.selectedValue);
             CmbItem.RemoveItem(CmbItem.selectedValue);
             CmbItem.selectedIndex = 0;
             LoadList();//ilustro cual es el estado de la lista actual
             ItemsCount--;
             LblItems.Text = "CANTIDAD DE ITEMS: " + ItemsCount;
             if (ItemsCount == 0)
             {
                 LblList.Text = "";
             }
         }
         else  //Si no hay un item seleccionado lo digo
         {
             LblErrorDelete.Text    = "*SELECCIONE UN ITEM";
             LblErrorDelete.Visible = true;
         }
     }
     else
     {//Si la lista no ha sido creada lo digo
         LblErrorDelete.Text    = "*NO EXISTE UNA LISTA";
         LblErrorDelete.Visible = true;
     }
 }
Esempio n. 3
0
        void SearchAction(object parameter)
        {
            var items = PartyBuildingContext.org2news;

            if (items == null || items.Count() < 1)
            {
                return;
            }
            if (txtCompName.Text.IsNotEmpty())
            {
                items = items.Where(m => m.comp_name.Contains(txtCompName.Text));
            }
            if (cmbIsEstablish.SelectedItem != null)
            {
                CmbItem sel = cmbIsEstablish.SelectedItem as CmbItem;
                items = items.Where(m => m.is_dzz_establish == sel.Text);
            }
            if (cmbEstablishType.SelectedItem != null)
            {
                CmbItem sel = cmbEstablishType.SelectedItem as CmbItem;
                items = items.Where(m => m.dzz_establish_type == sel.Text);
            }
            if (cmbHasActPlace != null)
            {
                CmbItem sel = cmbHasActPlace.SelectedItem as CmbItem;
                items = items.Where(m => m.has_atc_place == sel.Text);
            }

            dg.ItemsSource = items;
        }
Esempio n. 4
0
    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        //here on combobox selection, we are fetching predictions of selected sign
        // and add them in listbox
        CmbItem       selectedItem = (CmbItem)(((ComboBox)sender).SelectedItem);
        List <string> predictions  = Horoscope[selectedItem.tag].prediction;

        listBox1.Items.Clear();
        foreach (string pre in predictions)
        {
            listBox1.Items.Add(pre);
        }
    }
Esempio n. 5
0
        private IKeyProcess generateGenericKeyProc()
        {
            CmbItem item = (CmbItem)cmbVKey.SelectedItem;
            ushort  code = (ushort)item.VALUE;
            string  name = tbName.Text;

            if (name.Equals(""))
            {
                //name = "[0x" + code.ToString("X2") + "]" + item.NAME;
                name = item.NAME;
            }

            return(new GenericKeyProcess(name, (byte)code, cbxCtrl.Checked, cbxShift.Checked, cbxAlt.Checked));
        }
Esempio n. 6
0
        private void tbKeySelector_KeyDown(object sender, KeyEventArgs e)
        {
            cbxCtrl.Checked  = e.Control;
            cbxAlt.Checked   = e.Alt;
            cbxShift.Checked = e.Shift;

            tbName.Text = (e.Control ? "Ctrl + " : "") + (e.Shift ? "Shift + " : "") + (e.Alt ? "Alt + " : "");
            if (e.KeyCode != Keys.ShiftKey && e.KeyCode != Keys.Menu && e.KeyCode != Keys.ControlKey)
            {
                CmbItem item = items.Find(x => x.VALUE == (uint)e.KeyCode);
                cmbVKey.SelectedItem = item;
                tbName.Text         += item.NAME;
            }
        }
Esempio n. 7
0
 public Form1()
 {
     InitializeComponent();
     Horoscope.Add(1, new HoroscopeData("Aris"));
     Horoscope.Add(2, new HoroscopeData("Libra"));
     Horoscope.Add(3, new HoroscopeData("Leo"));
     //adding items in combobox, with tag which is associated with our main data
     //  so we can easily fetch prediction out of it whenever selection changes
     foreach (int tag in Horoscope.Keys)
     {
         CmbItem item = new CmbItem(Horoscope[tag].sign, tag);
         comboBox1.Items.Add(item);
     }
 }
Esempio n. 8
0
        void GetAreas(bool all = true)
        {
            var rst = HttpUtils.GetResult(ApiUtils.GetApiUrl(PartyBuildingApiKeys.AreaGet, PartyBuildingApiKeys.Key_ApiProvider_Party));

            if (rst.code != ResultCode.Success)
            {
                MessageWindow.ShowMsg(MessageType.Error, OperationDesc.Search, rst.msg);
                return;
            }
            if (rst.data != null && rst.data.infos != null)
            {
                var areas = JsonConvert.DeserializeObject <IEnumerable <PartyActAreaModel> >(((JArray)rst.data.infos).ToString());
                //
                var node = gpTree.SelectedItem as TreeViewData.TreeNode;
                if (node != null)
                {
                    if (node.Level == 2)
                    {
                        areas = areas.Where(a => a.town == node.Label);
                    }
                    else if (node.Level == 3)
                    {
                        areas = areas.Where(a => a.village == node.Label);
                    }
                }
                if (all)
                {
                    dg.ItemsSource = areas;
                    return;
                }
                if (txtLevel.Text.IsNotEmpty())
                {
                    areas = areas.Where(a => a.levels == txtLevel.Text);
                }
                if (txtRooms.Text.IsNotEmpty())
                {
                    areas = areas.Where(a => a.rooms == txtRooms.Text);
                }
                //建筑面积
                string  max = "", min = "";
                CmbItem sel = cmbFloorArea.SelectedValue as CmbItem;
                if (sel != null)
                {
                    if (sel.Text.Contains("以上"))
                    {
                        min = sel.Text.Replace("以上", "");
                    }
                    else if (sel.Text.Contains("以下"))
                    {
                        max = sel.Text.Replace("以下", "");
                    }
                    else
                    {
                        var arr = sel.Text.Split('~');
                        max = arr[1];
                        min = arr[0];
                    }
                    if (max.IsNotEmpty())
                    {
                        areas = areas.Where(a => Convert.ToInt32(a.floor_area) < Convert.ToInt32(max));
                    }
                    if (min.IsNotEmpty())
                    {
                        areas = areas.Where(a => Convert.ToInt32(a.floor_area) >= Convert.ToInt32(min));
                    }
                }
                //院落面积
                sel = cmbCourtyardArea.SelectedValue as CmbItem;
                if (sel != null)
                {
                    if (sel.Text.Contains("以上"))
                    {
                        min = sel.Text.Replace("以上", "");
                    }
                    else if (sel.Text.Contains("以下"))
                    {
                        max = sel.Text.Replace("以下", "");
                    }
                    else
                    {
                        var arr = sel.Text.Split('~');
                        max = arr[1];
                        min = arr[0];
                    }
                    if (max.IsNotEmpty())
                    {
                        areas = areas.Where(a => Convert.ToInt32(a.courtyard_area) < Convert.ToInt32(max));
                    }
                    if (min.IsNotEmpty())
                    {
                        areas = areas.Where(a => Convert.ToInt32(a.courtyard_area) >= Convert.ToInt32(min));
                    }
                }

                dg.ItemsSource = areas;
            }
        }
Esempio n. 9
0
        private void preencherDados()
        {
            if (pacientee != null)
            {
                string[] cp;
                txtNome.Text         = pacientee.Nome;
                dataNascimento.Value = pacientee.DataNascimento;
                txtRua.Text          = pacientee.Rua;
                txtNumeroCasa.Text   = Convert.ToString(pacientee.NumeroCasa);
                txtAndarPiso.Text    = pacientee.Andar;
                cp = pacientee.codigoPostal.Split('-');
                txtCodPostalPre.Text = Convert.ToString(cp[0]);
                txtCodPostalSuf.Text = Convert.ToString(cp[1]);
                txtLocalidade.Text   = pacientee.localidade;
                txtEmail.Text        = pacientee.Email;
                txtContacto.Text     = Convert.ToString(pacientee.Contacto);
                txtNif.Text          = Convert.ToString(pacientee.Nif);
                txtBairroLocal.Text  = pacientee.bairroLocal;
                txtDesignacao.Text   = pacientee.designacao;

                /*
                 * int a = 0;
                 * foreach (var item in cbProfissoes.Items)
                 * {
                 *  var tempMeasured = item.ToString();
                 *  if (tempMeasured.Equals(pacientee.Profissao))
                 *  {
                 *      cbProfissoes.SelectedIndex = a;
                 *  }
                 *  a++;
                 * }*/

                int prof = 0;
                foreach (var cbItem in cbProfissoes.Items)
                {
                    var temp = cbItem.ToString();
                    if (temp.Equals(pacientee.Profissao))
                    {
                        cbProfissoes.SelectedIndex = prof;
                    }
                    prof++;
                }

                int b = 0;
                foreach (var CmbItem in cbAcordos.Items)
                {
                    var tempMeasured = CmbItem.ToString();
                    if (tempMeasured.Equals(pacientee.Acordo))
                    {
                        cbAcordos.SelectedIndex = b;
                    }
                    b++;
                }

                txtNomeSeguradora.Text = pacientee.NomeSeguradora;
                txtNApolice.Text       = Convert.ToString(pacientee.NumeroApoliceSeguradora);

                txtNomeSubsistema.Text = pacientee.NomeSubsistema;
                txtNSubsistema.Text    = Convert.ToString(pacientee.NumeroSubsistema);
                txtSNS.Text            = Convert.ToString(pacientee.NumeroSNS);

                if (pacientee.Sexo.Equals("Masculino"))
                {
                    radioButtonMasculino.Checked = true;
                }

                if (pacientee.Sexo.Equals("Feminino"))
                {
                    radioButtonFeminino.Checked = true;
                }

                if (pacientee.Sexo.Equals("Indefinido"))
                {
                    radioButtonIndefinido.Checked = true;
                }

                if (pacientee.PlanoVacinacao.Equals("Atualizado"))
                {
                    radioButtonAtualizado.Checked = true;
                }
                if (pacientee.PlanoVacinacao.Equals("Não Atualizado"))
                {
                    radioButtonNaoAtualizado.Checked = true;
                }
            }
        }
Esempio n. 10
0
 private void FrmList_Load(object sender, EventArgs e)
 {
     CmbItem.AddItem("");
 }