Exemplo n.º 1
0
 public RateService(string connectionString)
 {
     db          = new LiteDbEntity(connectionString);
     AllEntities = db.getCollection <RateEntity>();
     if (AllEntities.Count != 0)
     {
         LastEntity = AllEntities.Last();
     }
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            ServiceEquipment service = new ServiceEquipment();

            string data = "";

            service.GetData <string, int>(data);



            #region
            Equipment equipment = new Equipment();
            equipment.Name      = "Computer";
            equipment.Model     = "Apple";
            equipment.Price     = 3000;
            equipment.IssueDate = DateTime.Now;
            equipment.Garantee  = 3;

            LiteDbEntity <Equipment> db_e =
                new LiteDbEntity <Equipment>(@"\\sd\City\SDP-181\Задание 03\Account.DB");

            if (db_e.obj == null)
            {
                System.Console.WriteLine("obj == null");
            }

            db_e.Add(equipment);
            #endregion


            SoftWare softWare = new SoftWare();
            softWare.Price         = 100;
            softWare.SoftwareTypes = SoftwareTypes.free;
            softWare.InstalDate    = DateTime.Now;
            //if(seq.SearchEquipment("Computer")!=null)
            //    softWare.Equipment = seq.SearchEquipment("Computer")[0];

            LiteDbEntity <SoftWare> db_s = new LiteDbEntity <SoftWare>(@"\\sd\City\SDP-181\Задание 03\Account.DB");
            db_s.Add(softWare);
        }