public class Doctors :IObject
{
public Doctors()
{
}
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
[MaxLength(25)]
public string Names { get; set; }
[MaxLength(40)]
public string Specialization { get; set; }
[MaxLength(40)]
public string Username { get; set; }
[MaxLength(40)]
public string Email { get; set; }
[MaxLength(40)]
public int Phoneno { get; set; }
[MaxLength(20)]
public string Password { get; set; }
[MaxLength(30)]
public string Confirmpassword { get; set; }
[MaxLength(30)]
public string Address { get; set; }
//------------------second table---------------------------//
public Patient()
{
}
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
[MaxLength (40)]
public string Name { get; set; }
[MaxLength(40)]
public string Username { get; set; }
[MaxLength(40)]
public string Password { get; set; }
[MaxLength(40)]
public string Confirmpassword { get; set; }
[MaxLength(40)]
public string Email { get; set; }
[MaxLength(20)]
public int Phoneno { get; set; }
[MaxLength(20)]
public class ItemDatabaseGeneric
{
static object locker = new object();
SQLiteConnection database;
public ItemDatabaseGeneric()
{
database = new SQLiteConnection(databasePath);
database.CreateTable
database.CreateTable
database.CreateTable
}
string databasePath
{
get
{
var dbName = "ItemsSQLite.db3";
#if __IOS__
string folder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
folder = Path.Combine(folder, "..", "Library");
var databasePath = Path.Combine(folder, dbName);
#else
#if __ANDROID__
string folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
var databasePath = Path.Combine(folder, dbName);
#else
// WinPhone
var databasePath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, dbName);;
#endif
#endif
return databasePath;
}
}
public IEnumerable
{
lock(locker)
{
return (from i in database.Table
}
}
public IEnumerable
{
lock (locker)
{
return database.Query
}
}
public IEnumerable
{
lock(locker)
{
return database.Query
}
}
// public IEnumerable
// select dt.Field
public T GetObject
{
lock(locker)
{
return database.Table
}
}
//public Task> GetPropertiesAsync()
//{
// return database.Table().ToListAsync();
//}
public T GetObject
{
lock (locker)
{
return database.Table
}
}
public int SaveObject
{
lock (locker)
{
if (obj.ID != 0)
{
database.Update(obj);
return obj.ID;
}
else
{
return database.Insert(obj);
}
}
}
public int DeleteObject
{
lock (locker)
{
return database.Delete
}
}
}}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Gokhul VarmanPosted Aug 9, 2017, 5:10 PM