private void RefResh() { this.gvSystemPerameter.DataSource = SystemParamService.Query().Select(item => new { SystemParmType = item.Type.GetDescription(), Value = item.Value, Remark = item.Remark, TypeOf = item.Type.ToString() }); this.DataBind(); }
protected void btnSubmit_Click(object sender, EventArgs e) { SystemParamType systemParamType = (SystemParamType)Enum.Parse(typeof(SystemParamType), Request.QueryString["type"].ToString()); try { SystemParamService.Update(systemParamType, this.txtValue.Text.ToString(), CurrentUser.UserName); RegisterScript("alert('修改成功!'); window.location.href='SystemParameter.aspx';"); } catch (Exception ex) { ShowExceptionMessage(ex, "修改"); } }
public static void SendFareError(FareErrorLog fare, decimal price) { try { IMailServiceProvider mail = new MailServiceProvider(); string receptionMailAddress = SystemParamService.QueryString(SystemParamType.SystemReceptionMailAddress); string serviceMailAdderess = SystemParamService.QueryString(SystemParamType.SystemServiceMailAddress); string serviceMailPassword = SystemParamService.QueryString(SystemParamType.SystemServiceMailPassword); string title = "记录价格变动信息"; string content = B3BEmailSender.GetFareCOnetnt(fare, price); MailMessages message = new MailMessages("B3b系统邮件", receptionMailAddress, title, content, serviceMailAdderess, serviceMailPassword, "QQ"); mail.SendMessage(message); } catch (Exception ex) { Service.LogService.SaveExceptionLog(ex, "发送邮件异常"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["type"] != null) { SystemParamType systemParamType = (SystemParamType)Enum.Parse(typeof(SystemParamType), Request.QueryString["type"].ToString()); SystemParam systemParam = SystemParamService.QueryParam(systemParamType); if (systemParam != null) { this.txtType.Text = Request.QueryString["TypeName"].ToString(); this.txtValue.Text = systemParam.Value; this.ttRemark.InnerText = systemParam.Remark; this.txtType.Enabled = false; this.ttRemark.Disabled = true; } } } }