/// <summary> /// 保存 /// </summary> /// <param name="vo"></param> /// <param name="templateId"></param> /// <returns></returns> public int SaveMessageTemplate(EntityDicMessageContent vo, out decimal templateId) { using (Biz210 biz = new Biz210()) { return(biz.SaveMessageTemplate(vo, out templateId)); } }
void New() { smsVo = new EntityDicMessageContent() { sId = 0, typeId = this.typeId, typeName = this.typeName }; SetContent(smsVo); }
void SetContent(EntityDicMessageContent vo) { this.typeId = vo.typeId; this.typeName = vo.typeName; this.cboTypeName.Text = vo.typeName; this.cboSuitGender.Text = vo.suitGenderDesc; this.cboSuitPersons.Text = vo.suitPersonsDesc; this.cboSuitSeason.Text = vo.suitSeasonDesc; this.txtSmsContent.Text = vo.smsContent; }
/// <summary> /// 保存 /// </summary> /// <param name="vo"></param> /// <param name="templateId"></param> /// <returns></returns> public int SaveMessageTemplate(EntityDicMessageContent vo, out decimal templateId) { int affectRows = 0; templateId = 0; string Sql = string.Empty; SqlHelper svc = null; try { svc = new SqlHelper(EnumBiz.onlineDB); if (vo.sId <= 0) { Sql = @"select max(t.sId) as maxId from dicMessageContent t"; DataTable dt = svc.GetDataTable(Sql); if (dt != null && dt.Rows.Count > 0) { if (dt.Rows[0]["maxId"] != DBNull.Value) { vo.sId = Convert.ToDecimal(dt.Rows[0]["maxId"]) + 1; } } if (vo.sId <= 0) { vo.sId = 1; } } List <DacParm> lstParm = new List <DacParm>(); lstParm.Add(svc.GetDelParmByPk(vo)); lstParm.Add(svc.GetInsertParm(vo)); affectRows = svc.Commit(lstParm); templateId = vo.sId; } catch (Exception e) { ExceptionLog.OutPutException(e); affectRows = -1; } finally { svc = null; } return(affectRows); }
/// <summary> /// New /// </summary> public override void New() { TreeListNode node = this.tvMsgType.FocusedNode; if (node.HasChildren) { DialogBox.Msg("请选择子节点。"); } else { EntityDicMessageContent newVo = new EntityDicMessageContent(); newVo.typeId = (this.tvMsgType.GetDataRecordByNode(node) as EntityDicMessageType).typeId; newVo.typeName = (this.tvMsgType.GetDataRecordByNode(node) as EntityDicMessageType).typeName; frmPopup21002 frm = new frmPopup21002(newVo); frm.ShowDialog(); if (frm.IsRequireRefresh) { this.LoadSmsContent(); this.FilterData(node); this.ScrollRow(frm.smsVo.sId); } } }
public frmPopup21002(EntityDicMessageContent _smsContent) { InitializeComponent(); smsVo = _smsContent; }