protected void lbtnSubmit_Click(object sender, EventArgs e) { try { ShipExpress model = null; if (string.IsNullOrEmpty(Request.QueryString["ID"])) {//新增 model = new ShipExpress(); GetValue(model); // BLLExpress.Add(model); KWebApiHelper <ShipExpress> .Post <ShipExpress>(KApiUrlConfig.ShipApiUrl, "Express/add", model); } else {//修改 model = KWebApiHelper <ShipExpress> .Get(KApiUrlConfig.ShipApiUrl, "Express/get/" + Request.QueryString["ID"].ToString()); GetValue(model); KWebApiHelper <bool> .Post <ShipExpress>(KApiUrlConfig.ShipApiUrl, "Express/edit", model); } ClientScript.RegisterStartupScript(this.GetType(), "success", "alert('操作成功!');parent.close1(true);", true); } catch (Exception ex) { string message = "添加失败!" + ex.Message; ClientScript.RegisterStartupScript(this.GetType(), "failed", "alert('" + message + "');", true); } }
protected void BindInfo() { List <ShipExpress> expressList = KWebApiHelper <List <ShipExpress> > .Get(KApiUrlConfig.ShipApiUrl, "express/list"); this.rpList.DataSource = expressList; this.rpList.DataBind(); }
private void BindInfo() { string id = Request.QueryString["ID"].ToString(); ShipExpress model = KWebApiHelper <ShipExpress> .Get(KApiUrlConfig.ShipApiUrl, "Express/get/" + id); if (model != null) { SetValue(model); } }