protected void btnUpdate_Click(object sender, EventArgs e) { string lb = Request.QueryString["查询类别"]; string tj = Request.QueryString["查询条件"]; string lr = Request.QueryString["查询内容"]; string lr1 = Request.QueryString["查询内容1"]; string lr2 = Request.QueryString["查询内容2"]; string id = Request.QueryString["id"]; ProductArea area = new ProductArea { Id = Convert.ToInt32(id), Name = name.Text, Phone = phone.Text, Remark = remark.Text }; bool result = ProductAreaDal.Update(area); if (result) { string url; url = "chaxun.aspx?查询类别=" + lb + "&查询条件=" + tj + "&查询内容=" + lr + "&查询内容1=" + lr1 + "&查询内容2=" + lr2; Response.Redirect(url); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('更新记录失败!')", true); } }
public static ProductArea Get(int id) { ProductArea area = new ProductArea(); string sqlstr = "select * from gy_KName where k_ID =" + id + " "; SqlData da = new SqlData(); SqlDataReader read = da.ExceRead(sqlstr); read.Read(); if (read.HasRows) { area.Id = id; area.Name = read["k_name"].ToString(); area.Phone = read["k_phone"].ToString(); area.Remark = read["k_remark"].ToString(); } read.Close(); return area; }
protected void btnAdd_Click(object sender, EventArgs e) { if (Page.IsValid) { ProductArea area = new ProductArea(); area.Name = name.Text; area.Phone = phone.Text; area.Remark = remark.Text; bool result = ProductAreaDal.Add(area); if (result) { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('注册成功!');location='addproducingarea.aspx'", true); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('注册失败!')", true); } } }
public async Task <ProductArea> AddProductAreaAsync(ProductAreaView productArea, CancellationToken cancellationToken) { if (productArea == null) { throw new ArgumentNullException(nameof(productArea)); } var dbProductArea = new ProductArea { AreaId = productArea.AreaId, ProductId = productArea.ProductId, Length = productArea.Length, Width = productArea.Width, Income = productArea.Income, Profit = productArea.Profit, CreatedAt = DateTime.UtcNow }; await _context.ProductAreas.AddAsync(dbProductArea, cancellationToken); return(dbProductArea); }
public static bool Add(ProductArea area) { SqlData da = new SqlData(); string useradd = "insert into gy_KName(K_name,K_phone,K_remark)values('" + area.Name + "','" + area.Phone + "','" + area.Remark + "')"; return da.ExceSQL(useradd); }
public static bool Update(ProductArea area) { SqlData da = new SqlData(); string update = "update gy_KName set k_name='" + area.Name + "',k_phone='" + area.Phone+ "',k_remark='" + area.Remark + "' where k_ID='" + area.Id + "'"; return da.ExceSQL(update); }
private static IEnumerable <CaseFormat> TagASummaryToArea(string summary, ProductArea productArea) => productArea.categories .Select(category => TagASummaryToCategory(summary, category)) .Where(caseFormat => caseFormat.categoryAndConnectionType.Count != 0);