Exemplo n.º 1
0
        public static string GetNextNumber(PositivityModel dbModel, string SPname)
        {
            var param = new SqlParameter("@p", System.Data.SqlDbType.NVarChar);

            param.Direction = System.Data.ParameterDirection.Output;
            param.Size      = 100;
            dbModel.Database.ExecuteSqlCommand("EXEC " + SPname + " @p output", param);

            return(param.Value.ToString());
        }
Exemplo n.º 2
0
        protected PositivityModel InitiateDbContext()
        {
            PositivityModel dbModel = new PositivityModel();

            //dbModel.Configuration.ProxyCreationEnabled = false;
            //dbModel.Configuration.LazyLoadingEnabled = true;

            //dbModel.Database.Log = s => Debug.WriteLine( s );

            return(dbModel);
        }
Exemplo n.º 3
0
 protected IList <T> GetLookupCollection <T>() where T : class
 {
     try
     {
         PositivityModel dbModel = new PositivityModel();
         return(dbModel.Set <T>().ToList());
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.ToString());
         throw;
     }
 }