private void lbl_baocun_Click(object sender, EventArgs e) { //构造一个root传入ruleinfo中 JJmodel.WjmRuleRoot ruleRoot = new WjmRuleRoot(); ruleRoot.ruleExplain = tb_explain.Text; foreach (Control myc in flp_my.Controls) { CheckBox cb = myc as CheckBox; if (cb.Checked) { ruleRoot.position.Add(cb.Text); } } ruleRoot.delete = tb_delete.Text; ruleRoot.newText = tb_new.Text; ruleRoot.replace0 = tb_replace0.Text; ruleRoot.replace = tb_replace.Text; //构造一个ruleinfo RuleInfo ri = new RuleInfo(tb_rulename.Text, SystemInfo._currentModule, ruleRoot, SystemInfo._userInfo._shiming, DateTime.Now.ToString("yyyy-MM-dd")); //保存到数据库的规则信息表中 ri.SaveRuleInfo(); this.DialogResult = DialogResult.OK; }
private void lbl_baocun_Click(object sender, EventArgs e) { //构造一个root传入ruleinfo中 JJmodel.DsjRuleRoot ruleRoot = new DsjRuleRoot(); ruleRoot._ruleExplain = tb_explain.Text; foreach (Control myc in flp_xinxi.Controls) { if (myc is CheckBox && (myc as CheckBox).Checked) { ruleRoot._xinxiku.Add(myc.Text); } } foreach (Control myc in flp_fanwei.Controls) { CheckBox cb = myc as CheckBox; if (cb.Checked) { ruleRoot._fanwei.Add(cb.Text); } } foreach (Control myc in flp_biaozhu.Controls) { CheckBox cb = myc as CheckBox; if (cb.Checked) { ruleRoot._biaozhu.Add(cb.Text); } } foreach (Control myc in flp_mingci.Controls) { CheckBox cb = myc as CheckBox; if (myc is CheckBox && (myc as CheckBox).Checked) { ruleRoot._mingci.Add(myc.Text); } } foreach (Control myc in flp_chonghe.Controls) { if (myc is CheckBox && (myc as CheckBox).Checked) { ruleRoot._chonghe.Add(myc.Text); } } //构造一个ruleinfo _ruleInfo = new RuleInfo(tb_rulename.Text, SystemInfo._currentModule, ruleRoot, SystemInfo._userInfo._shiming, DateTime.Now.ToString("yyyy-MM-dd")); //保存到数据库的规则信息表中 _ruleInfo.SaveRuleInfo(); this.DialogResult = DialogResult.OK; }
/// <summary> /// 点击保存按钮时触发的事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void lbl_baocun_Click(object sender, EventArgs e) { BzhRuleRoot _myRoot = new BzhRuleRoot(); _myRoot._shuoming = tb_explain.Text; //大标题 _myRoot._dbthjType = cbb_dbthj.Text; _myRoot._dbthjValue = nud_dbthjvalue.Value; _myRoot._dbtdqType = cbb_dbtdq.Text; _myRoot._dbtkh = Convert.ToInt32(cbb_dbtkh.Text); _myRoot._dbtzt = tb_dbtzt.Text; _myRoot._dbtzh = nud_dbtzh.Value; _myRoot._dbtct = cb_dbtct.Checked; _myRoot._dbtsj = nud_dbtsj.Value; //副标题 ; _myRoot._fbthjType = cbb_fbthj.Text; _myRoot._fbthjValue = nud_fbthjvalue.Value; _myRoot._fbtdqType = cbb_fbtdq.Text; _myRoot._fbtkh = Convert.ToInt32(cbb_fbtkh.Text); _myRoot._fbtzt = tb_fbtzt.Text; _myRoot._fbtzh = nud_fbtzh.Value; _myRoot._fbtct = cb_fbtct.Checked; _myRoot._fbtsj = nud_fbtsj.Value; //正文 ; _myRoot._zwhjType = cbb_zwhj.Text; _myRoot._zwhjValue = nud_zwhjvalue.Value; _myRoot._zwdqType = cbb_zwdq.Text; _myRoot._zwkh = Convert.ToInt32(cbb_zwkh.Text); _myRoot._zwzt = tb_zwzt.Text; _myRoot._zwzh = nud_zwzh.Value; _myRoot._zwct = cb_zwct.Checked; _myRoot._zwsj = nud_zwsj.Value; //一级标题 ; _myRoot._yjbthjType = cbb_yjbthj.Text; _myRoot._yjbthjValue = nud_yjbthjvalue.Value; _myRoot._yjbtdqType = cbb_yjbtdq.Text; _myRoot._yjbtkh = Convert.ToInt32(cbb_yjbtkh.Text); _myRoot._yjbtzt = tb_yjbtzt.Text; _myRoot._yjbtzh = nud_yjbtzh.Value; _myRoot._yjbtct = cb_yjbtct.Checked; _myRoot._yjbtsj = nud_yjbtsj.Value; //二级标题 ; _myRoot._ejbthjType = cbb_ejbthj.Text; _myRoot._ejbthjValue = nud_ejbthjvalue.Value; _myRoot._ejbtdqType = cbb_ejbtdq.Text; _myRoot._ejbtkh = Convert.ToInt32(cbb_ejbtkh.Text); _myRoot._ejbtzt = tb_ejbtzt.Text; _myRoot._ejbtzh = nud_ejbtzh.Value; _myRoot._ejbtct = cb_ejbtct.Checked; _myRoot._ejbtsj = nud_ejbtsj.Value; //三级标题 ; _myRoot._sjbthjType = cbb_sjbthj.Text; _myRoot._sjbthjValue = nud_sjbthjvalue.Value; _myRoot._sjbtdqType = cbb_sjbtdq.Text; _myRoot._sjbtkh = Convert.ToInt32(cbb_sjbtkh.Text); _myRoot._sjbtzt = tb_sjbtzt.Text; _myRoot._sjbtzh = nud_sjbtzh.Value; _myRoot._sjbtct = cb_sjbtct.Checked; _myRoot._sjbtsj = nud_sjbtsj.Value; //页边距 ; _myRoot._zuobianju = nud_zuobianju.Value; _myRoot._youbianju = nud_youbianju.Value; _myRoot._shangbianju = nud_shangbianju.Value; _myRoot._xiabianju = nud_xiabianju.Value; //页眉设置 ; _myRoot._yemeinr = tb_ymnr.Text; _myRoot._yemeizt = tb_ymzt.Text; _myRoot._yemeizh = nud_ymzh.Value; _myRoot._yemeict = cb_ymct.Checked; _myRoot._yemeijz = cbb_ymjz.Text; //页脚设置 ; _myRoot._yjnr = tb_yjnr.Text; _myRoot._yjzt = tb_yjzt.Text; _myRoot._yjzh = nud_yjzh.Value; _myRoot._yjct = cb_yjct.Checked; _myRoot._yjjz = cbb_yjjz.Text; //页码设置 ; _myRoot._ymgs = cbb_ymags.Text; _myRoot._ymzt = cbb_ymazt.Text; _myRoot._ymjz = cbb_ymajz.Text; //文中空行消除 ; _myRoot._khxc = cb_xckh.Checked; //标注名称 ; _myRoot._bzmc = tb_name.Text; //文本范围 ; _myRoot._wbfw = tb_fanwei.Text; //文本内容 ; _myRoot._wbnr = tb_neirong.Text; //构造一个ruleinfo _ruleInfo = new RuleInfo(tb_rulename.Text, SystemInfo._currentModule, _myRoot, SystemInfo._userInfo._shiming, DateTime.Now.ToString("yyyy-MM-dd")); //保存到数据库的规则信息表中 _ruleInfo.SaveRuleInfo(); this.DialogResult = DialogResult.OK; }