Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This file was automatically generated by the PetaPoco T4 Template
- // Do not make changes directly to this file - edit the template instead
- //
- // The following connection settings were used to generate this file
- //
- // Connection String Name: `DBConnection`
- // Provider: `MySql.Data.MySqlClient`
- // Connection String: `server=vserver213.axc.nl;user id=lesleya213_pts41;database=lesleya213_pts41;password=pts41`
- // Schema: ``
- // Include Views: `False`
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using PetaPoco;
- namespace DBConnection
- {
- public partial class DBConnectionDB : Database
- {
- public DBConnectionDB()
- : base("DBConnection")
- {
- CommonConstruct();
- }
- public DBConnectionDB(string connectionStringName)
- : base(connectionStringName)
- {
- CommonConstruct();
- }
- partial void CommonConstruct();
- public interface IFactory
- {
- DBConnectionDB GetInstance();
- }
- public static IFactory Factory { get; set; }
- public static DBConnectionDB GetInstance()
- {
- if (_instance!=null)
- return _instance;
- if (Factory!=null)
- return Factory.GetInstance();
- else
- return new DBConnectionDB();
- }
- [ThreadStatic] static DBConnectionDB _instance;
- public override void OnBeginTransaction()
- {
- if (_instance==null)
- _instance=this;
- }
- public override void OnEndTransaction()
- {
- if (_instance==this)
- _instance=null;
- }
- public class Record<T> where T:new()
- {
- public static DBConnectionDB repo { get { return DBConnectionDB.GetInstance(); } }
- public bool IsNew() { return repo.IsNew(this); }
- public object Insert() { return repo.Insert(this); }
- public void Save() { repo.Save(this); }
- public int Update() { return repo.Update(this); }
- public int Update(IEnumerable<string> columns) { return repo.Update(this, columns); }
- public static int Update(string sql, params object[] args) { return repo.Update<T>(sql, args); }
- public static int Update(Sql sql) { return repo.Update<T>(sql); }
- public int Delete() { return repo.Delete(this); }
- public static int Delete(string sql, params object[] args) { return repo.Delete<T>(sql, args); }
- public static int Delete(Sql sql) { return repo.Delete<T>(sql); }
- public static int Delete(object primaryKey) { return repo.Delete<T>(primaryKey); }
- public static bool Exists(object primaryKey) { return repo.Exists<T>(primaryKey); }
- public static bool Exists(string sql, params object[] args) { return repo.Exists<T>(sql, args); }
- public static T SingleOrDefault(object primaryKey) { return repo.SingleOrDefault<T>(primaryKey); }
- public static T SingleOrDefault(string sql, params object[] args) { return repo.SingleOrDefault<T>(sql, args); }
- public static T SingleOrDefault(Sql sql) { return repo.SingleOrDefault<T>(sql); }
- public static T FirstOrDefault(string sql, params object[] args) { return repo.FirstOrDefault<T>(sql, args); }
- public static T FirstOrDefault(Sql sql) { return repo.FirstOrDefault<T>(sql); }
- public static T Single(object primaryKey) { return repo.Single<T>(primaryKey); }
- public static T Single(string sql, params object[] args) { return repo.Single<T>(sql, args); }
- public static T Single(Sql sql) { return repo.Single<T>(sql); }
- public static T First(string sql, params object[] args) { return repo.First<T>(sql, args); }
- public static T First(Sql sql) { return repo.First<T>(sql); }
- public static List<T> Fetch(string sql, params object[] args) { return repo.Fetch<T>(sql, args); }
- public static List<T> Fetch(Sql sql) { return repo.Fetch<T>(sql); }
- public static List<T> Fetch(long page, long itemsPerPage, string sql, params object[] args) { return repo.Fetch<T>(page, itemsPerPage, sql, args); }
- public static List<T> Fetch(long page, long itemsPerPage, Sql sql) { return repo.Fetch<T>(page, itemsPerPage, sql); }
- public static List<T> SkipTake(long skip, long take, string sql, params object[] args) { return repo.SkipTake<T>(skip, take, sql, args); }
- public static List<T> SkipTake(long skip, long take, Sql sql) { return repo.SkipTake<T>(skip, take, sql); }
- public static Page<T> Page(long page, long itemsPerPage, string sql, params object[] args) { return repo.Page<T>(page, itemsPerPage, sql, args); }
- public static Page<T> Page(long page, long itemsPerPage, Sql sql) { return repo.Page<T>(page, itemsPerPage, sql); }
- public static IEnumerable<T> Query(string sql, params object[] args) { return repo.Query<T>(sql, args); }
- public static IEnumerable<T> Query(Sql sql) { return repo.Query<T>(sql); }
- }
- }
- [TableName("lesleya213_pts41.Appointment")]
- [PrimaryKey("id")]
- [ExplicitColumns]
- public partial class Appointment : DBConnectionDB.Record<Appointment>
- {
- [Column] public int id { get; set; }
- [Column] public int doctor_id { get; set; }
- [Column] public int patient_id { get; set; }
- [Column] public DateTime date { get; set; }
- [Column] public string reason { get; set; }
- [Column] public string description { get; set; }
- [Column] public string comments { get; set; }
- }
- [TableName("lesleya213_pts41.Drug")]
- [PrimaryKey("id")]
- [ExplicitColumns]
- public partial class Drug : DBConnectionDB.Record<Drug>
- {
- [Column] public int id { get; set; }
- [Column] public string name { get; set; }
- [Column] public string description { get; set; }
- [Column] public string description_en_us { get; set; }
- }
- [TableName("lesleya213_pts41.Log")]
- [PrimaryKey("id")]
- [ExplicitColumns]
- public partial class Log : DBConnectionDB.Record<Log>
- {
- [Column] public int id { get; set; }
- [Column] public int doctor_id { get; set; }
- [Column] public string Action { get; set; }
- }
- [TableName("lesleya213_pts41.Notification")]
- [PrimaryKey("id")]
- [ExplicitColumns]
- public partial class Notification : DBConnectionDB.Record<Notification>
- {
- [Column] public int id { get; set; }
- [Column] public int senderId { get; set; }
- [Column] public int patientId { get; set; }
- [Column] public string message { get; set; }
- [Column] public string time { get; set; }
- }
- [TableName("lesleya213_pts41.Pharmacy")]
- [PrimaryKey("id")]
- [ExplicitColumns]
- public partial class Pharmacy : DBConnectionDB.Record<Pharmacy>
- {
- [Column] public int id { get; set; }
- [Column] public string name { get; set; }
- }
- [TableName("lesleya213_pts41.Prescription")]
- [PrimaryKey("id")]
- [ExplicitColumns]
- public partial class Prescription : DBConnectionDB.Record<Prescription>
- {
- [Column] public int id { get; set; }
- [Column] public int patient_id { get; set; }
- [Column] public int drug_id { get; set; }
- [Column] public int appointmentid { get; set; }
- [Column] public DateTime? date_collected { get; set; }
- [Column] public string description { get; set; }
- }
- [TableName("lesleya213_pts41.Storage")]
- [PrimaryKey("id")]
- [ExplicitColumns]
- public partial class Storage : DBConnectionDB.Record<Storage>
- {
- [Column] public int id { get; set; }
- [Column] public int drug_id { get; set; }
- [Column] public int amount { get; set; }
- [Column] public int pharmacyid { get; set; }
- }
- [TableName("lesleya213_pts41.User")]
- [PrimaryKey("id")]
- [ExplicitColumns]
- public partial class User : DBConnectionDB.Record<User>
- {
- [Column] public int id { get; set; }
- [Column] public string username { get; set; }
- [Column] public int? doctorid { get; set; }
- [Column] public DAL.Models.Role usertype { get; set; }
- [Column] public string emailaddress { get; set; }
- [Column] public string name { get; set; }
- [Column] public string lastname { get; set; }
- [Column] public string password { get; set; }
- [Column] public string phonenumber { get; set; }
- [Column] public DateTime birthdate { get; set; }
- [Column] public sbyte isblocked { get; set; }
- [Column] public bool changedpassword { get; set; }
- [Column] public byte[] picture { get; set; }
- }
- [TableName("lesleya213_pts41.Worktimes")]
- [PrimaryKey("id", AutoIncrement=false)]
- [ExplicitColumns]
- public partial class Worktime : DBConnectionDB.Record<Worktime>
- {
- [Column] public int id { get; set; }
- [Column] public int userid { get; set; }
- [Column] public int starthour { get; set; }
- [Column] public int endhour { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement