protected void Button1_Click(object sender, EventArgs e) { if (this.TextBox1.Text != null) { ProductsType s = new ProductsType(); s.TypeName = this.TextBox1.Text; s.Description = this.TextBox2.Text; //s.State = this.DropDownList2.Text; if (this.DropDownList1.Text == "正常") { s.State = "Y"; } else { s.State = "N"; } int rows = ProductsTypeManager.ProductsTypeInsert(s); if (rows > 0) { Response.Write("<script>alert('添加成功!');</script>"); this.TextBox1.Text = ""; this.TextBox2.Text = ""; this.DropDownList1.Text = "正常"; } else { Response.Write("<script>alert('添加失败!');</script>"); } } else { Response.Write("<script>alert('类型名称不能为空!');</script>"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; int index = Convert.ToInt32(context.Request["rows"]); int rows = Convert.ToInt32(context.Request["page"]); context.Response.Write("{\"total\":" + ProductsTypeManager.ProductsTypezong() + ",\"rows\":" + JsonConvert.SerializeObject(ProductsTypeManager.ProductsTypeALL(index, rows)) + "}"); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (context.Request["id"] != null) { context.Response.Write(ProductsTypeManager.ProductsTypeDelete(Convert.ToInt32(context.Request["id"])) > 0); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (context.Request["id"] != null) { context.Response.Write(JsonConvert.SerializeObject(ProductsTypeManager.ProductsTypeID(Convert.ToInt32(context.Request["id"])))); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (context.Request["TypeName"] != null) { ProductsType s = new ProductsType(); s.TypeID = Convert.ToInt32(context.Request["TypeID"]); s.TypeName = context.Request["TypeName"]; s.State = context.Request["State"]; s.Description = context.Request["Description"]; context.Response.Write(ProductsTypeManager.ProductsTypeUpdate(s) > 0); } }