SHARE
TWEET

Untitled

a guest May 23rd, 2018 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // This file was automatically generated by the PetaPoco T4 Template
  3. // Do not make changes directly to this file - edit the template instead
  4. //
  5. // The following connection settings were used to generate this file
  6. //
  7. //     Connection String Name: `DBConnection`
  8. //     Provider:               `MySql.Data.MySqlClient`
  9. //     Connection String:      `server=vserver213.axc.nl;user id=lesleya213_pts41;database=lesleya213_pts41;password=pts41`
  10. //     Schema:                 ``
  11. //     Include Views:          `False`
  12.  
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Linq;
  16. using System.Web;
  17. using PetaPoco;
  18.  
  19. namespace DBConnection
  20. {
  21.     public partial class DBConnectionDB : Database
  22.     {
  23.         public DBConnectionDB()
  24.             : base("DBConnection")
  25.         {
  26.             CommonConstruct();
  27.         }
  28.  
  29.         public DBConnectionDB(string connectionStringName)
  30.             : base(connectionStringName)
  31.         {
  32.             CommonConstruct();
  33.         }
  34.        
  35.         partial void CommonConstruct();
  36.        
  37.         public interface IFactory
  38.         {
  39.             DBConnectionDB GetInstance();
  40.         }
  41.        
  42.         public static IFactory Factory { get; set; }
  43.         public static DBConnectionDB GetInstance()
  44.         {
  45.             if (_instance!=null)
  46.                 return _instance;
  47.                
  48.             if (Factory!=null)
  49.                 return Factory.GetInstance();
  50.             else
  51.                 return new DBConnectionDB();
  52.         }
  53.  
  54.         [ThreadStatic] static DBConnectionDB _instance;
  55.        
  56.         public override void OnBeginTransaction()
  57.         {
  58.             if (_instance==null)
  59.                 _instance=this;
  60.         }
  61.        
  62.         public override void OnEndTransaction()
  63.         {
  64.             if (_instance==this)
  65.                 _instance=null;
  66.         }
  67.        
  68.         public class Record<T> where T:new()
  69.         {
  70.             public static DBConnectionDB repo { get { return DBConnectionDB.GetInstance(); } }
  71.             public bool IsNew() { return repo.IsNew(this); }
  72.             public object Insert() { return repo.Insert(this); }
  73.             public void Save() { repo.Save(this); }
  74.             public int Update() { return repo.Update(this); }
  75.             public int Update(IEnumerable<string> columns) { return repo.Update(this, columns); }
  76.             public static int Update(string sql, params object[] args) { return repo.Update<T>(sql, args); }
  77.             public static int Update(Sql sql) { return repo.Update<T>(sql); }
  78.             public int Delete() { return repo.Delete(this); }
  79.             public static int Delete(string sql, params object[] args) { return repo.Delete<T>(sql, args); }
  80.             public static int Delete(Sql sql) { return repo.Delete<T>(sql); }
  81.             public static int Delete(object primaryKey) { return repo.Delete<T>(primaryKey); }
  82.             public static bool Exists(object primaryKey) { return repo.Exists<T>(primaryKey); }
  83.             public static bool Exists(string sql, params object[] args) { return repo.Exists<T>(sql, args); }
  84.             public static T SingleOrDefault(object primaryKey) { return repo.SingleOrDefault<T>(primaryKey); }
  85.             public static T SingleOrDefault(string sql, params object[] args) { return repo.SingleOrDefault<T>(sql, args); }
  86.             public static T SingleOrDefault(Sql sql) { return repo.SingleOrDefault<T>(sql); }
  87.             public static T FirstOrDefault(string sql, params object[] args) { return repo.FirstOrDefault<T>(sql, args); }
  88.             public static T FirstOrDefault(Sql sql) { return repo.FirstOrDefault<T>(sql); }
  89.             public static T Single(object primaryKey) { return repo.Single<T>(primaryKey); }
  90.             public static T Single(string sql, params object[] args) { return repo.Single<T>(sql, args); }
  91.             public static T Single(Sql sql) { return repo.Single<T>(sql); }
  92.             public static T First(string sql, params object[] args) { return repo.First<T>(sql, args); }
  93.             public static T First(Sql sql) { return repo.First<T>(sql); }
  94.             public static List<T> Fetch(string sql, params object[] args) { return repo.Fetch<T>(sql, args); }
  95.             public static List<T> Fetch(Sql sql) { return repo.Fetch<T>(sql); }
  96.             public static List<T> Fetch(long page, long itemsPerPage, string sql, params object[] args) { return repo.Fetch<T>(page, itemsPerPage, sql, args); }
  97.             public static List<T> Fetch(long page, long itemsPerPage, Sql sql) { return repo.Fetch<T>(page, itemsPerPage, sql); }
  98.             public static List<T> SkipTake(long skip, long take, string sql, params object[] args) { return repo.SkipTake<T>(skip, take, sql, args); }
  99.             public static List<T> SkipTake(long skip, long take, Sql sql) { return repo.SkipTake<T>(skip, take, sql); }
  100.             public static Page<T> Page(long page, long itemsPerPage, string sql, params object[] args) { return repo.Page<T>(page, itemsPerPage, sql, args); }
  101.             public static Page<T> Page(long page, long itemsPerPage, Sql sql) { return repo.Page<T>(page, itemsPerPage, sql); }
  102.             public static IEnumerable<T> Query(string sql, params object[] args) { return repo.Query<T>(sql, args); }
  103.             public static IEnumerable<T> Query(Sql sql) { return repo.Query<T>(sql); }
  104.         }
  105.     }
  106.    
  107.  
  108.    
  109.     [TableName("lesleya213_pts41.Appointment")]
  110.     [PrimaryKey("id")]
  111.     [ExplicitColumns]
  112.     public partial class Appointment : DBConnectionDB.Record<Appointment>  
  113.     {
  114.         [Column] public int id { get; set; }
  115.         [Column] public int doctor_id { get; set; }
  116.         [Column] public int patient_id { get; set; }
  117.         [Column] public DateTime date { get; set; }
  118.         [Column] public string reason { get; set; }
  119.         [Column] public string description { get; set; }
  120.         [Column] public string comments { get; set; }
  121.     }
  122.    
  123.     [TableName("lesleya213_pts41.Drug")]
  124.     [PrimaryKey("id")]
  125.     [ExplicitColumns]
  126.     public partial class Drug : DBConnectionDB.Record<Drug>  
  127.     {
  128.         [Column] public int id { get; set; }
  129.         [Column] public string name { get; set; }
  130.         [Column] public string description { get; set; }
  131.         [Column] public string description_en_us { get; set; }
  132.     }
  133.    
  134.     [TableName("lesleya213_pts41.Log")]
  135.     [PrimaryKey("id")]
  136.     [ExplicitColumns]
  137.     public partial class Log : DBConnectionDB.Record<Log>  
  138.     {
  139.         [Column] public int id { get; set; }
  140.         [Column] public int doctor_id { get; set; }
  141.         [Column] public string Action { get; set; }
  142.     }
  143.    
  144.     [TableName("lesleya213_pts41.Notification")]
  145.     [PrimaryKey("id")]
  146.     [ExplicitColumns]
  147.     public partial class Notification : DBConnectionDB.Record<Notification>  
  148.     {
  149.         [Column] public int id { get; set; }
  150.         [Column] public int senderId { get; set; }
  151.         [Column] public int patientId { get; set; }
  152.         [Column] public string message { get; set; }
  153.         [Column] public string time { get; set; }
  154.     }
  155.    
  156.     [TableName("lesleya213_pts41.Pharmacy")]
  157.     [PrimaryKey("id")]
  158.     [ExplicitColumns]
  159.     public partial class Pharmacy : DBConnectionDB.Record<Pharmacy>  
  160.     {
  161.         [Column] public int id { get; set; }
  162.         [Column] public string name { get; set; }
  163.     }
  164.    
  165.     [TableName("lesleya213_pts41.Prescription")]
  166.     [PrimaryKey("id")]
  167.     [ExplicitColumns]
  168.     public partial class Prescription : DBConnectionDB.Record<Prescription>  
  169.     {
  170.         [Column] public int id { get; set; }
  171.         [Column] public int patient_id { get; set; }
  172.         [Column] public int drug_id { get; set; }
  173.         [Column] public int appointmentid { get; set; }
  174.         [Column] public DateTime? date_collected { get; set; }
  175.         [Column] public string description { get; set; }
  176.     }
  177.    
  178.     [TableName("lesleya213_pts41.Storage")]
  179.     [PrimaryKey("id")]
  180.     [ExplicitColumns]
  181.     public partial class Storage : DBConnectionDB.Record<Storage>  
  182.     {
  183.         [Column] public int id { get; set; }
  184.         [Column] public int drug_id { get; set; }
  185.         [Column] public int amount { get; set; }
  186.         [Column] public int pharmacyid { get; set; }
  187.     }
  188.    
  189.     [TableName("lesleya213_pts41.User")]
  190.     [PrimaryKey("id")]
  191.     [ExplicitColumns]
  192.     public partial class User : DBConnectionDB.Record<User>  
  193.     {
  194.         [Column] public int id { get; set; }
  195.         [Column] public string username { get; set; }
  196.         [Column] public int? doctorid { get; set; }
  197.         [Column] public DAL.Models.Role usertype { get; set; }
  198.         [Column] public string emailaddress { get; set; }
  199.         [Column] public string name { get; set; }
  200.         [Column] public string lastname { get; set; }
  201.         [Column] public string password { get; set; }
  202.         [Column] public string phonenumber { get; set; }
  203.         [Column] public DateTime birthdate { get; set; }
  204.         [Column] public sbyte isblocked { get; set; }
  205.         [Column] public bool changedpassword { get; set; }
  206.         [Column] public byte[] picture { get; set; }
  207.     }
  208.    
  209.     [TableName("lesleya213_pts41.Worktimes")]
  210.     [PrimaryKey("id", AutoIncrement=false)]
  211.     [ExplicitColumns]
  212.     public partial class Worktime : DBConnectionDB.Record<Worktime>  
  213.     {
  214.         [Column] public int id { get; set; }
  215.         [Column] public int userid { get; set; }
  216.         [Column] public int starthour { get; set; }
  217.         [Column] public int endhour { get; set; }
  218.     }
  219. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top