public MainWindow() { InitializeComponent(); db = new Db_Context(); db.dbSet.Load(); StudentGrid.ItemsSource = db.dbSet.Select(p => p).ToList(); }
public HttpExampleFunction(Db_Context context) { _context = context; }
public Repository(Db_Context context) { _context = context; }
public CallbackResult CallBack_FormTag_65200_9() { /*id=request.id&allowempty=author,view&action=edit*/ string formname = this.CallValue("formname"); if (formname != "FormTag_65200_9") { return(null); } dynamic error = new ExpandoObject(); error.formname = formname; CallbackResult call = new CallbackResult(error); call.type = "formcall"; Article _article = null; long long_id = long.MinValue; long.TryParse("" + Request.QueryString["id"], out long_id); _article = Db_Context.Article.Where(x => x.IsLock != true).FirstOrDefault(b => b.ID == long_id ); if (_article == null) { /*编辑模式(action = edit),未找到记录则返回*/; error.code = 3; error.msg = "操作失败:not found!"; error.dom = ""; return(call); } string _Title = this.CallValue("Title"); if (string.IsNullOrEmpty(_Title)) { error.code = 1; error.msg = "不能为空!"; error.dom = "Title"; return(call); } _article.Title = _Title; string _Author = this.CallValue("Author"); _article.Author = _Author; string _Time = this.CallValue("Time"); DateTime __Time = DateTime.Now; if (DateTime.TryParse(_Time, out __Time)) { _article.Time = __Time; } else { if (string.IsNullOrEmpty(_Time)) { error.code = 1; error.msg = "不能为空!"; error.dom = "Time"; return(call); } else { error.code = 2; error.msg = "请输入正确的时间"; error.dom = "Time"; return(call); } } string _View = this.CallValue("View"); int __View = 0; if (int.TryParse(_View, out __View)) { _article.View = __View; } string _Content = this.CallValue("Content"); if (string.IsNullOrEmpty(_Content)) { error.code = 1; error.msg = "不能为空!"; error.dom = "Content"; return(call); } _article.Content = _Content; // Db_Context.SaveChanges(); error.code = 0; error.msg = "操作成功!"; error.dom = ""; return(call); }
public EmailController(Db_Context ctx) { this.ctx = ctx; }
public FeedbackController(Db_Context c) { ctx = c; }
public OrderRepository(Db_Context ctx, ILogger <OrderRepository> logger) : base(ctx) { _ctx = ctx; _logger = logger; }
public MainWindow() { db = new Db_Context(); }
public ProductRepository(Db_Context ctx, ILogger <ProductRepository> logger) : base(ctx) { _ctx = ctx; _logger = logger; }
public FlightController(Db_Context dbContext) { this.ctx = dbContext; }
public Imp_DepremDepo(Db_Context context) { _context = context; }