using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using CY.Model; using CY.BLL; using CY.Infrastructure.Common; using CY.Infrastructure.Query; using CY.BLL.Sys; namespace CY.WebForm.Pages.adminclient { //吴辉 //软件销售记录回访 public partial class BackVisitNoteEdit : BasePage { Soft_SellRecordBLL bll_Soft_SellRecordBLL = null; Soft_ManageBLL bll_Soft_ManageBLL = null; //初始化 public BackVisitNoteEdit() { bll_Soft_SellRecordBLL = new Soft_SellRecordBLL(); bll_Soft_ManageBLL = new Soft_ManageBLL(); } // 界面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitData(); } } //数据加载 public void InitData() { Soft_SellRecord m_Soft_SellRecord = bll_Soft_SellRecordBLL.GetModelByKeyid(Request["keyid"].ToInt32()); if (m_Soft_SellRecord != null) { this.spanClientName.InnerText = m_Soft_SellRecord.ClientName; this.spanOrderNum.InnerText = m_Soft_SellRecord.OrderNum; this.spanSoftName.InnerText = m_Soft_SellRecord.SoftName; this.spanMoney.InnerText = m_Soft_SellRecord.OrderMoney + "元 =数量:" + m_Soft_SellRecord.SoftQuantity + "×单价:" + m_Soft_SellRecord.SoftUnitprice+"元"; this.spanStatus.InnerText = (m_Soft_SellRecord.VisitStatus == 1 ? "已回访" : "未回访"); if (m_Soft_SellRecord.VisitStatus == 1) { this.selSoftSc.Value = m_Soft_SellRecord.VisitSoftScore; this.selServerSc.Value = m_Soft_SellRecord.VisitSoftServers; this.spnLastUpdateTime.InnerText = m_Soft_SellRecord.VisitTime.Value.ToString("yyyy-MM-dd HH:mm"); this.spnOperator.InnerText = m_Soft_SellRecord.VisitPeople; this.txtAdvice.Value = m_Soft_SellRecord.VisitProposal; this.txtReason.Value = m_Soft_SellRecord.VisitReason; } else { this.selSoftSc.Value = "一般"; this.selServerSc.Value = "一般"; this.spnLastUpdateTime.InnerText = DateTime.Now.ToString("yyyy-MM-dd HH:mm"); this.spnOperator.InnerText = CurrentUser.ShortName; this.txtAdvice.Value = ""; this.txtReason.Value = ""; } } } //表单提交 protected void btn_submit_form(object sender, EventArgs e) { try { DateTime nowTime = DateTime.Now; Soft_SellRecord m_Soft_SellRecord = bll_Soft_SellRecordBLL.GetModelByKeyid(Request["keyid"].ToInt32()); m_Soft_SellRecord.VisitStatus = 1; m_Soft_SellRecord.VisitSoftScore = this.selSoftSc.Value; m_Soft_SellRecord.VisitSoftServers = this.selServerSc.Value; m_Soft_SellRecord.VisitReason = this.txtReason.Value; m_Soft_SellRecord.VisitProposal = this.txtAdvice.Value; m_Soft_SellRecord.VisitPeople = CurrentUser.ShortName; m_Soft_SellRecord.VisitTime = nowTime; if (bll_Soft_SellRecordBLL.UpdateModel(m_Soft_SellRecord)) { JavaScript.MessageBox("操作成功", this, false, true); InitData(); } else JavaScript.MessageBox("操作失败", this); } catch (Exception ex) { PAGEHandleException(ex); JavaScript.MessageBox("操作失败", this); } } } }