// GET: Job public ActionResult Query(string name, int?pay) { ViewData["title"] = "職缺管理"; var queryresult = EFService.Query(name, pay); return(View("Index", queryresult)); }
// GET api/values/5 public string Get(int id) { using (var connection = new SqlConnection("Data Source=localhost;database=donet61;Uid=sa;pwd=sa")) { using (var transaction = connection.BeginTransaction(_capBus, autoCommit: false)) { //业务代码 string sql = "update [donet61].[dbo].[T_User] set UserName = '******' Where id = 1 "; //这里的事务是指 发送消息和执行当前SQL一致性 connection.Execute(sql, transaction: transaction); _capBus.Publish("xxx.services.update.username", "12", "callback-show-execute-time"); transaction.Commit(_capBus); } } var service = new EFService(); service.CreateDatabase(); service.InsertTransFalse(); return("value:" + 1); }
public string getStudentByid(int id) { UserInfo s1 = EFService.GetUserInfo($"SELECT * FROM `UserInfo` where UserID={id}"); return(Newtonsoft.Json.JsonConvert.SerializeObject(s1)); }
public ActionResult Edit(Guid id) { var item = EFService.Query(id); if (item == null) { return(HttpNotFound()); } return(View(item)); }
// GET: Job public ActionResult Add(jobs item) { if (ModelState.IsValid) { EFService.Add(item); } else { return(View(item)); } return(RedirectToAction("index")); }
/// <summary> /// Create an instance of type EFProvider /// </summary> /// <param name="service"></param> /// <param name="container"></param> public EFProvider(EFService service, AstoriaDefaultServiceDBEntities container) : base(new DataServiceProviderArgs(service, container, null, false)) {}
// GET: Job public ActionResult Update(jobs item) { EFService.Edit(item); return(View("Index")); }
// GET: Job public ActionResult Update(Guid id) { var result = EFService.Query(id); return(View("Edit", result)); }
// GET: Job public ActionResult Del(Guid id) { EFService.Del(id); return(RedirectToAction("Index")); }