protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["st"] != null) { string strid = Request.QueryString["st"]; NCPEP.Model.T_jtnc model = new NCPEP.Model.T_jtnc(); NCPEP.Bll.T_jtnc bll = new NCPEP.Bll.T_jtnc(); model = bll.GetModel(int.Parse(strid)); this.hdzb.Value = model.dizhi; strname = model.mingcheng; txtx.Text = model.zuobiaox; txty.Text = model.zuobiaoy; } } }
protected void Button1_Click(object sender, EventArgs e) { if (Request.QueryString["st"] != null) { string strid = Request.QueryString["st"]; NCPEP.Model.T_jtnc model = new NCPEP.Model.T_jtnc(); NCPEP.Bll.T_jtnc bll = new NCPEP.Bll.T_jtnc(); model = bll.GetModel(int.Parse(strid)); if (!string.IsNullOrEmpty(txtx.Text)) { model.zuobiaox = txtx.Text; } if (!string.IsNullOrEmpty(txty.Text)) { model.zuobiaoy = txty.Text; } bll.Update(model); MessageBox.ShowAndRedirect(this, "设置成功!", "listnc.aspx?pg=" + Request.QueryString["pg"] + ""); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(NCPEP.Model.T_jtnc model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(NCPEP.Model.T_jtnc model) { return(dal.Add(model)); }