private void ShowInfo(int CID) { CHSS.BLL.CCommunityAgency bll = new CHSS.BLL.CCommunityAgency(); CHSS.Model.CCommunityAgency model = bll.GetModel(CID); this.txtCID.Text = model.CID.ToString(); this.txtCommDescription.Text = model.CommDescription; this.txtCommAddDate.Text = model.CommAddDate; this.txtCommName.Text = model.CommName; }
protected void btnSave_Click(object sender, EventArgs e) { string CommDescription = this.txtCommDescription.Text; string CommAddDate = this.txtCommAddDate.Text; string CommName = this.txtCommName.Text; int UID = int.Parse(Session["UID"].ToString()); CHSS.Model.CCommunityAgency model = new CHSS.Model.CCommunityAgency(); model.CommDescription = CommDescription; model.CommAddDate = CommAddDate; model.CommName = CommName; model.UID = UID; CHSS.BLL.CCommunityAgency bll = new CHSS.BLL.CCommunityAgency(); bll.Add(model); Response.Redirect("Show.aspx?id=" + (bll.GetMaxId() - 1)); }
public void btnSave_Click(object sender, EventArgs e) { int CID = int.Parse(this.txtCID.Text); string CommDescription = this.txtCommDescription.Text; string CommAddDate = this.txtCommAddDate.Text; string CommName = this.txtCommName.Text; int UID = int.Parse(Session["UID"].ToString()); CHSS.Model.CCommunityAgency model = new CHSS.Model.CCommunityAgency(); model.CID = CID; model.CommDescription = CommDescription; model.CommAddDate = CommAddDate; model.CommName = CommName; model.UID = UID; CHSS.BLL.CCommunityAgency bll = new CHSS.BLL.CCommunityAgency(); bll.Update(model); Response.Redirect("Show.aspx?id=" + CID); }