Exemple #1
0
        internal static ClienteCollectionBE GetClienteCollection()
        {
            ClienteCollectionBE wClienteCollectionBE = new ClienteCollectionBE();

            #region crear objetos
            ClienteBE wClienteBE = new ClienteBE();
            Random    rnd        = new Random();
            wClienteBE.IdCliente       = rnd.Next(100000);
            wClienteBE.Nombre          = "Marcelo";
            wClienteBE.Apellido        = "Oviedo";
            wClienteBE.Edad            = 32;
            wClienteBE.FechaNacimiento = System.DateTime.Now;
            wClienteCollectionBE.Add(wClienteBE);

            //wClienteBE = new ClienteBE();

            //wClienteBE.IdCliente = rnd.Next(100000);
            //wClienteBE.Nombre = "Javier";
            //wClienteBE.Apellido = "Oviedo";
            //wClienteBE.Edad = 30;
            //wClienteBE.FechaNacimiento = Convert.ToDateTime("1976-10-18T00:00:00");
            //wClienteCollectionBE.Add(wClienteBE);
            #endregion
            return(wClienteCollectionBE);
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 bool Load()
 {
     try
     {
         frmSelectItem selectItemForm = new frmSelectItem();
         if (selectItemForm.ShowDialog() == DialogResult.OK)
         {
             if (string.IsNullOrEmpty(selectItemForm.ItemKey))
             {
                 MessageBox.Show("Debe ingresar un identificador para el item");
                 return(false);
             }
             _Id = selectItemForm.ItemKey;
             _ClienteCollectionBE = ClienteCollectionBE.GetClienteCollectionBE(primitivesResultsTextBox.Text);
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         MessageBox.Show("El xml no permite la serializacion del onjeto ClienteCollectionBE..sera regenerado");
         _ClienteCollectionBE          = Helper.GetClienteCollection();
         primitivesResultsTextBox.Text = _ClienteCollectionBE.GetXml();
         return(false);
     }
 }
        private void primitivesReadButton_Click(object sender, EventArgs e)
        {
            if (selectItemForm.ShowDialog() == DialogResult.OK)
            {
                ClienteCollectionBE wClienteCollectionBE = (ClienteCollectionBE)CacheManager.GetData(selectItemForm.ItemKey);

                if (wClienteCollectionBE != null)
                {
                    primitivesResultsTextBox.Text += wClienteCollectionBE.GetXml() + Environment.NewLine;
                }
                else
                {
                    primitivesResultsTextBox.Text += string.Format("No se encuentra en cache el item", selectItemForm.ItemKey) + Environment.NewLine;
                }
            }
        }
Exemple #4
0
 public frmAddItem()
 {
     InitializeComponent();
     _ClienteCollectionBE          = Helper.GetClienteCollection();
     primitivesResultsTextBox.Text = _ClienteCollectionBE.GetXml();
 }