protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            RegEntity regEntity = new RegEntity();

            regEntity.Name     = "xyz";
            regEntity.Password = "******";
            regEntity.Username = "******";

            //save obj in local db
            MainVm.SaveEmployeeInDB(regEntity, MainApplication.Database);

            Button button = FindViewById <Button>(Resource.Id.myButton);

            //
            RegEntity objw = MainVm.GetEmp("snehjadhav", MainApplication.Database);

            button.Click += delegate { button.Text = $"{count++} clicks!"; };
        }
Esempio n. 2
0
 public int SaveItem(RegEntity item)
 {
     lock (locker)
     {
         if (item.ID != 0)
         {
             //Update Item
             database.Update(item);
             return(item.ID);
         }
         else
         {
             //Insert item
             return(database.Insert(item));
         }
     }
 }
Esempio n. 3
0
 public void Update(RegEntity entity)
 {
     _context.Entry(entity).State = EntityState.Modified;
 }
Esempio n. 4
0
 public void Remove(RegEntity entity)
 {
     _context.Remove(entity);
 }
Esempio n. 5
0
 public async void AddAsync(RegEntity entity)
 {
     await _context.RegRecords.AddAsync(entity);
 }