本文整理汇总了C#中deneysan_DAL.Context.DeneysanContext类的典型用法代码示例。如果您正苦于以下问题:C# DeneysanContext类的具体用法?C# DeneysanContext怎么用?C# DeneysanContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeneysanContext类属于deneysan_DAL.Context命名空间,在下文中一共展示了DeneysanContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditUser
public static bool EditUser(User model)
{
using (DeneysanContext db = new DeneysanContext())
{
try
{
User record = db.User.Where(d => d.UserId == model.UserId).SingleOrDefault();
if (record != null)
{
record.FullName = model.FullName;
record.Email = model.Email;
if(model.Password != "") record.Password = model.Password;
record.Institution = model.Institution;
record.Contact = model.Contact;
db.SaveChanges();
return true;
}
else return false;
}
catch (Exception)
{
return false;
}
}
}
示例2: DeleteGroup
public static bool DeleteGroup(int id)
{
using (DeneysanContext db = new DeneysanContext())
{
try
{
var record = db.ProjectGroup.FirstOrDefault(d => d.ProjectGroupId == id);
db.ProjectGroup.Remove(record);
db.SaveChanges();
//LogtrackManager logkeeper = new LogtrackManager();
//logkeeper.LogDate = DateTime.Now;
//logkeeper.LogProcess = EnumLogType.DokumanGrup.ToString();
//logkeeper.Message = LogMessages.ProjectGroupDeleted;
//logkeeper.User = HttpContext.Current.User.Identity.Name;
//logkeeper.Data = record.GroupName;
//logkeeper.AddInfoLog(logger);
return true;
}
catch (Exception)
{
return false;
}
}
}
示例3: EditInstituional
public static bool EditInstituional(Institutional record)
{
using (DeneysanContext db = new DeneysanContext())
{
try
{
Institutional editrecord = db.Institutional.SingleOrDefault(d => d.TypeId == record.TypeId && d.Language == record.Language);
if (editrecord == null)
{
editrecord = new Institutional();
editrecord.TimeUpdated = DateTime.Now;
editrecord.TypeId = record.TypeId;
editrecord.Language = record.Language;
editrecord.Content = record.Content;
db.Institutional.Add(editrecord);
}
else
{
editrecord.TimeUpdated = DateTime.Now;
editrecord.Content = record.Content;
}
db.SaveChanges();
return true;
}
catch (Exception)
{
return false;
}
}
}
示例4: GetAdminFirst
public static AdminUser GetAdminFirst()
{
using (DeneysanContext db = new DeneysanContext())
{
return db.AdminUser.FirstOrDefault();
}
}
示例5: EditNews
public static dynamic EditNews(News newsmodel)
{
using (DeneysanContext db = new DeneysanContext())
{
try
{
News record = db.News.Where(d => d.NewsId == newsmodel.NewsId && d.Deleted == false).SingleOrDefault();
if (record != null)
{
record.Header = newsmodel.Header;
record.Language = newsmodel.Language;
record.Content = newsmodel.Content;
if (!string.IsNullOrEmpty(newsmodel.NewsImage))
{
record.NewsImage = newsmodel.NewsImage;
}
record.PageSlug = newsmodel.PageSlug;
record.TimeUpdated = DateTime.Now;
record.Spot = newsmodel.Spot;
db.SaveChanges();
return true;
}
else
return false;
}
catch (Exception ex)
{
return false;
}
}
}
示例6: AddReference
public static bool AddReference(References record)
{
using (DeneysanContext db = new DeneysanContext())
{
try
{
if (!record.TimeCreated.HasValue)
record.TimeCreated = DateTime.Now;
record.Deleted = false;
record.Online = true;
db.References.Add(record);
db.SaveChanges();
LogtrackManager logkeeper = new LogtrackManager();
logkeeper.LogDate = DateTime.Now;
logkeeper.LogProcess = EnumLogType.Referans.ToString();
logkeeper.Message = LogMessages.ReferenceAdded;
logkeeper.User = HttpContext.Current.User.Identity.Name;
logkeeper.Data = record.ReferenceName;
logkeeper.AddInfoLog(logger);
return true;
}
catch (Exception ex)
{
return false;
}
}
}
示例7: Delete
public static bool Delete(int id)
{
using (DeneysanContext db = new DeneysanContext())
{
try
{
var record = db.News.FirstOrDefault(d => d.NewsId == id);
record.Deleted = true;
db.SaveChanges();
LogtrackManager logkeeper = new LogtrackManager();
logkeeper.LogDate = DateTime.Now;
logkeeper.LogProcess = EnumLogType.Haber.ToString();
logkeeper.Message = LogMessages.NewsDeleted;
logkeeper.User = HttpContext.Current.User.Identity.Name;
logkeeper.Data = record.Header;
logkeeper.AddInfoLog(logger);
return true;
}
catch (Exception)
{
return false;
}
}
}
示例8: AddProduct
public static bool AddProduct(Product record)
{
using (DeneysanContext db = new DeneysanContext())
{
try
{
record.TimeCreated = DateTime.Now;
record.Deleted = false;
record.Online = true;
record.SortNumber = 9999;
db.Product.Add(record);
db.SaveChanges();
//LogtrackManager logkeeper = new LogtrackManager();
//logkeeper.LogDate = DateTime.Now;
//logkeeper.LogProcess = EnumLogType.Dokuman.ToString();
//logkeeper.Message = LogMessages.ProductAdded;
//logkeeper.User = HttpContext.Current.User.Identity.Name;
//logkeeper.Data = record.Name;
//logkeeper.AddInfoLog(logger);
return true;
}
catch (Exception ex)
{
return false;
}
}
}
示例9: AddBankInfo
public static bool AddBankInfo(BankInfo record)
{
using (DeneysanContext db = new DeneysanContext())
{
try
{
record.Online = true;
db.BankInfo.Add(record);
db.SaveChanges();
LogtrackManager logkeeper = new LogtrackManager();
logkeeper.LogDate = DateTime.Now;
logkeeper.LogProcess = EnumLogType.BankaBilgisi.ToString();
logkeeper.Message = LogMessages.BankAdded;
logkeeper.User = HttpContext.Current.User.Identity.Name;
logkeeper.Data = record.BankName;
logkeeper.AddInfoLog(logger);
return true;
}
catch (Exception ex)
{
return false;
}
}
}
示例10: GetProjectListForFront
public static List<Projects> GetProjectListForFront(string language)
{
using (DeneysanContext db = new DeneysanContext())
{
var list = db.Projects.Where(d => d.Language == language && d.Online==true).OrderBy(d => d.SortOrder).ToList();
return list;
}
}
示例11: GetMailUsersList
public static List<MailUsers> GetMailUsersList(int type)
{
using (DeneysanContext db = new DeneysanContext())
{
var list = db.MailUsers.Where(d => d.MailType == type).ToList();
return list;
}
}
示例12: GetBankInfoListForFront
public static List<BankInfo> GetBankInfoListForFront(string language)
{
using (DeneysanContext db = new DeneysanContext())
{
var list = db.BankInfo.Where(d => d.Language == language && d.Online==true).ToList();
return list;
}
}
示例13: GetHRByLanguage
public static HumanResource GetHRByLanguage(string language)
{
using (DeneysanContext db = new DeneysanContext())
{
HumanResource instional_info = db.HumanResource.SingleOrDefault(d => d.Language == language);
return instional_info;
}
}
示例14: GetDocumentGroupList
public static List<DocumentGroup> GetDocumentGroupList(string language)
{
using (DeneysanContext db = new DeneysanContext())
{
var list = db.DocumentGroup.Where(d => d.Deleted == false && d.Language == language).OrderBy(d=>d.SortNumber).ToList();
return list;
}
}
示例15: GetProductGroupListForFront
public static List<ProductGroup> GetProductGroupListForFront(string language)
{
using (DeneysanContext db = new DeneysanContext())
{
var list = db.ProductGroup.Where(d => d.Deleted == false && d.Language == language && d.Online==true).OrderBy(d => d.SortNumber).ToList();
return list;
}
}