public IHttpActionResult Put处理方法(Guid id, 处理方法 处理方法) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != 处理方法.Id) { return(BadRequest()); } db.Entry(处理方法).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!处理方法Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Post处理方法(处理方法 处理方法) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.处理方法.Add(处理方法); try { db.SaveChanges(); } catch (DbUpdateException) { if (处理方法Exists(处理方法.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = 处理方法.Id }, 处理方法)); }
public IHttpActionResult Get处理方法(Guid id) { 处理方法 处理方法 = db.处理方法.Find(id); if (处理方法 == null) { return(NotFound()); } return(Ok(处理方法)); }
public IHttpActionResult GetCC(string id, Guid lb, bool pass, string mt) { Guid guid; if (id.Length > 10) { guid = new Guid(id); } else { guid = db.HashTables.First(x => x.Hash == id).Id; } 皮囊硫化 皮囊硫化 = null; 处理方法 处理方法 = null; try { 皮囊硫化 = db.皮囊硫化s.Single <皮囊硫化>(x => x.成型皮囊 == guid && x.除 == false); 处理方法 = db.处理方法s.FirstOrDefault(x => x.处理方法1.Contains(mt.Trim()) && x.除 == false); } catch (Exception) { //throw; } if (皮囊硫化 == null) { return(NotFound()); } 检验修边 检验修边 = new 检验修边(); 检验修边.Id = Guid.NewGuid(); 检验修边.检验员 = lb; 检验修边.登记时间 = DateTime.Now; 检验修边.结果 = pass; 检验修边.硫化皮囊 = 皮囊硫化.Id; if (处理方法 != null) { 检验修边.处理方法 = 处理方法.Id; } else { 检验修边.处理方法 = null; } db.检验修边s.InsertOnSubmit(检验修边); db.SubmitChanges(); return(Ok(检验修边)); }
private void btn_CLFFAdd_Click(object sender, EventArgs e) { using (TransactionScope scope = new TransactionScope()) { 处理方法 temp = new 处理方法(); temp.Id = Guid.NewGuid(); temp.处理方法1 = tb_CLFF.Text; temp.附件 = tb_CLFFFJ.Text; temp.登记时间 = DateTime.Now; ddc.处理方法s.InsertOnSubmit(temp); ddc.SubmitChanges(); scope.Complete(); } LoadData(); }