using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.Model; using CY.Infrastructure.Common; using CY.BLL.Info; using CY.BLL; namespace CY.WebForm.Pages.procurement { //吴辉 //企业网站信息 public partial class Firm_ExInfo : BasePage { Info_FirmBLL _Info_FirmBLL = null; public Firm_ExInfo() { _Info_FirmBLL = new Info_FirmBLL(); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitialData(); } } protected void InitialData() { Info_Firm model = _Info_FirmBLL.selectSingleModel(CurrentUser.MemberId); if (model != null) { this.txtbussinessScope.Value = model.bussinessScope; this.txtfirmInfoBottom.Value = model.firmInfoBottom; this.txtFirmInroduce.Value = model.FirmInroduce; this.txtFrimContactInfo.Value = model.FrimContactInfo; } } protected void btn_Submit_Click(object sender, EventArgs e) { Info_Firm newModel = new Info_Firm(); newModel.bussinessScope = txtbussinessScope.Value; newModel.firmInfoBottom = txtfirmInfoBottom.Value; newModel.FirmInroduce = txtFirmInroduce.Value; newModel.FrimContactInfo = txtFrimContactInfo.Value; newModel.MemberId = CurrentUser.MemberId; Info_Firm oldModel = _Info_FirmBLL.selectSingleModel(CurrentUser.MemberId); if (oldModel != null) { if (_Info_FirmBLL.UpdateModel(newModel)) { JavaScript.MessageBox("更新成功", this); } else { JavaScript.MessageBox("更新失败", this); } } else { if (_Info_FirmBLL.InsertModel(newModel)) { JavaScript.MessageBox("插入成功", this); } else { JavaScript.MessageBox("插入成功", this); } } } } }