621 lines
21 KiB
C#
621 lines
21 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using SOH.Entities;
|
|
using EAS.Services;
|
|
using SOH.BLL;
|
|
using SOH.Window;
|
|
|
|
namespace SOH.SaleSettings
|
|
{
|
|
public partial class frmKeHuDingDanFenZuCZ : VerificationForm
|
|
{
|
|
private short fddm; //分店代码
|
|
|
|
public frmKeHuDingDanFenZuCZ(ts_ddfzb o, int zt, frmKeHuDingDanCZ cs)
|
|
{
|
|
InitializeComponent();
|
|
this.o = o;
|
|
this.zt = zt;
|
|
this.cz = cs;
|
|
}
|
|
public frmKeHuDingDanFenZuCZ(int ddbm, frmKeHuDingDanCZ cs)
|
|
{
|
|
InitializeComponent();
|
|
//this.ddbm = ddbm;
|
|
this.ddbm = ddbm;
|
|
this.zt = 1;
|
|
this.cz = cs;
|
|
}
|
|
frmKeHuDingDanCZ cz;
|
|
ts_ddfzb o;
|
|
int ddbm = 0;
|
|
int zt;
|
|
private void frmKeHuDingDanFenZuCZ_Load(object sender, EventArgs e)
|
|
{
|
|
//获取分店代码
|
|
string fddmstr = LoginUser.yydm;
|
|
short fd = 0;
|
|
short.TryParse(fddmstr, out fd);
|
|
fddm = fd;
|
|
|
|
cbjctc.DataSource = ServiceContainer.GetService<ITaoCan>().getTaoCanList2("0");
|
|
cbbks.DataSource = ServiceContainer.GetService<It_ks>().GetAllks("", -1, 0);
|
|
cbbfz.DataSource = ServiceContainer.GetService<Its_ddfzb>().GetddfzbByddbm((ddbm == 0) ? o.ddbm : ddbm);
|
|
cbbfz.SelectedIndex = -1;
|
|
if (zt == 0)
|
|
{
|
|
tzhxmBindingSource.DataSource = ServiceContainer.GetService<It_zhxm>().GetzhxmByddfzbm(o.ddfzbm);
|
|
lbddfzbm.Text = o.ddfzbm.ToString();
|
|
tbddfzmc.Text = o.ddfzmc;
|
|
tbfzjg.Text = Math.Round((Convert.ToDecimal(o.fzjg) / 100), 2).ToString();//Convert.ToDecimal(Convert.ToInt32(o.fzjg) / 100).ToString();
|
|
//tbfzjg.Text = o.fzjg.ToString();
|
|
tbfzzl.Text = o.fzzl.ToString();
|
|
lbfzzt.Text = o.fzzt.ToString();
|
|
cbbgzfbj.SelectedIndex = o.gzfbj;
|
|
cbbhyzk.SelectedIndex = o.hyzk;
|
|
cbbjxgzfbj.SelectedIndex = o.jxgzfbj;
|
|
tbjxzl.Text = o.jxzl.ToString();
|
|
tbnlsx.Text = o.nlsx.ToString();
|
|
tbnlxx.Text = o.nlxx.ToString();
|
|
cbbqbfs.SelectedIndex = o.qbfs;
|
|
cbbsfzj.SelectedIndex = o.sfzj;
|
|
tbssjg.Text = Math.Round((Convert.ToDecimal(o.ssjg) / 100), 2).ToString();//Convert.ToDecimal(Convert.ToInt32(o.ssjg) / 100).ToString();
|
|
cbbtjlb.SelectedIndex = o.tjlb;
|
|
cbbxb.SelectedIndex = o.xb;
|
|
tbyjfy.Text = Math.Round((Convert.ToDecimal(o.yjfy) / 100), 2).ToString();
|
|
tbyjrs.Text = o.yjrs.ToString();
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
cbbgzfbj.SelectedIndex = 0;
|
|
cbbhyzk.SelectedIndex = 0;
|
|
cbbjxgzfbj.SelectedIndex = 1;
|
|
cbbqbfs.SelectedIndex = 0;
|
|
cbbsfzj.SelectedIndex = 0;
|
|
cbbtjlb.SelectedIndex = 0;
|
|
cbbxb.SelectedIndex = 0;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
if (!check())
|
|
{
|
|
return ;
|
|
}
|
|
if (zt == 0)
|
|
{
|
|
ts_ddfzb o1 = ServiceContainer.GetService<Its_ddfzb>().GetddfzbByddbm(o.ddbm)[0];
|
|
o1.ddfzbm = Convert.ToInt32(lbddfzbm.Text);
|
|
o1.tcbm = Convert.ToInt32(cbjctc.SelectedValue);
|
|
o1.ddfzmc = tbddfzmc.Text;
|
|
o1.fzjg = Convert.ToInt32(Convert.ToDecimal(tbfzjg.Text) * 100);
|
|
o1.fzzl = Convert.ToInt16(tbfzzl.Text);
|
|
o1.fzzt = 0;
|
|
o1.gzfbj = Convert.ToInt16(cbbgzfbj.SelectedIndex);
|
|
o1.hyzk = Convert.ToInt16(cbbhyzk.SelectedIndex);
|
|
o1.jxgzfbj = Convert.ToInt16(cbbjxgzfbj.SelectedIndex);
|
|
o1.jxzl = Convert.ToInt16(tbjxzl.Text);
|
|
o1.nlsx = Convert.ToInt16(tbnlsx.Text);
|
|
o1.nlxx = Convert.ToInt16(tbnlxx.Text);
|
|
o1.qbfs = Convert.ToInt16(cbbqbfs.SelectedIndex);
|
|
o1.sfzj = Convert.ToInt16(cbbsfzj.SelectedIndex);
|
|
o1.ssjg = Convert.ToInt32(Convert.ToDecimal(tbssjg.Text) * 100);
|
|
o1.tjlb = Convert.ToInt16(cbbtjlb.SelectedIndex);
|
|
o1.xb = Convert.ToInt16(cbbxb.SelectedIndex);
|
|
o1.yjfy = Convert.ToInt32(Convert.ToDecimal(tbyjfy.Text) * 100);
|
|
o1.yjrs = Convert.ToInt32(tbyjrs.Text);
|
|
|
|
SOH.Data.OperationResult or = ServiceContainer.GetService<Its_ddfzb>().Updatedd(o1);
|
|
List<t_zhxm> al = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
SOH.Data.OperationResult or1 = ServiceContainer.GetService<Its_ddxmb>().Saveddxb(al, o1.ddfzbm);
|
|
MessageBox.Show(or.Message);
|
|
}
|
|
else
|
|
{
|
|
ts_ddfzb o = new ts_ddfzb();
|
|
o.ddbm = ddbm;
|
|
o.ddfzbm = ServiceContainer.GetService<IBasic>().GetMax(o.DbTableName, -1); //Convert.ToInt32(lbddfzbm.Text);
|
|
o.ddfzmc = tbddfzmc.Text;
|
|
o.fzjg = Convert.ToInt32(Convert.ToDecimal(tbfzjg.Text) * 100);
|
|
o.fzzl = Convert.ToInt16(tbfzzl.Text);
|
|
o.fzzt = 0;
|
|
o.tcbm = Convert.ToInt32(cbjctc.SelectedValue);
|
|
o.gzfbj = Convert.ToInt16(cbbgzfbj.SelectedIndex);
|
|
o.hyzk = Convert.ToInt16(cbbhyzk.SelectedIndex);
|
|
o.jxgzfbj = Convert.ToInt16(cbbjxgzfbj.SelectedIndex);
|
|
o.jxzl = Convert.ToInt16(tbjxzl.Text);
|
|
o.nlsx = Convert.ToInt16(tbnlsx.Text);
|
|
o.nlxx = Convert.ToInt16(tbnlxx.Text);
|
|
o.qbfs = Convert.ToInt16(cbbqbfs.SelectedIndex);
|
|
o.sfzj = Convert.ToInt16(cbbsfzj.SelectedIndex);
|
|
o.ssjg = Convert.ToInt32(Convert.ToDecimal(tbssjg.Text) * 100);
|
|
o.tjlb = Convert.ToInt16(cbbtjlb.SelectedIndex);
|
|
o.xb = Convert.ToInt16(cbbxb.SelectedIndex);
|
|
o.yjfy = Convert.ToInt32(Convert.ToDecimal(tbyjfy.Text) * 100);
|
|
o.yjrs = Convert.ToInt32(tbyjrs.Text);
|
|
SOH.Data.OperationResult or = ServiceContainer.GetService<Its_ddfzb>().Insertdd(o);
|
|
List<t_zhxm> al = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
SOH.Data.OperationResult or1 = ServiceContainer.GetService<Its_ddxmb>().Saveddxb(al, o.ddfzbm);
|
|
MessageBox.Show(or.Message);
|
|
}
|
|
cz.frmKeHuDingDanCZ_Load(sender, e);
|
|
this.Close();
|
|
}
|
|
|
|
private void textBox10_TextChanged(object sender, EventArgs e)
|
|
{
|
|
string zjf = this.textBox10.Text.Trim();
|
|
|
|
tzhxmBindingSource1.DataSource = ServiceContainer.GetService<It_zhxm>().GetzhxmByzjm(zjf);
|
|
}
|
|
|
|
private void cbjctc_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
|
|
tzhxmBindingSource.DataSource = ServiceContainer.GetService<ITaoCan>().getTCMX(Convert.ToInt16(this.cbjctc.SelectedValue));
|
|
List<t_zhxm> al = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString();
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
}
|
|
|
|
private void cbjctc_SelectedValueChanged(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void cbjctc_TextChanged(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void cbbks_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
tzhxmBindingSource1.DataSource = ServiceContainer.GetService<It_zhxm>().GetzhxmByks(Convert.ToInt16(this.cbbks.SelectedValue),Convert.ToInt32(LoginUser.yydm));
|
|
|
|
}
|
|
|
|
private void dataGridView1_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
if (dataGridView1.CurrentRow.Index < 0)
|
|
{
|
|
return;
|
|
}
|
|
t_zhxm o = dataGridView1.Rows[dataGridView1.CurrentRow.Index].DataBoundItem as t_zhxm;
|
|
tzhxmBindingSource.Remove(o);
|
|
List<t_zhxm> al = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString();
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
}
|
|
|
|
private void cbbfz_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
tzhxmBindingSource.DataSource = ServiceContainer.GetService<It_zhxm>().GetzhxmByddfzbm(Convert.ToInt32(this.cbbfz.SelectedValue));
|
|
List<t_zhxm> al = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString() ;
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
}
|
|
|
|
public bool ceshiZhxm(short xb,short hyzk)
|
|
{
|
|
bool f = false;
|
|
switch (this.cbbxb.SelectedIndex)
|
|
{
|
|
case 0:
|
|
if (xb == 1)
|
|
{
|
|
MessageBox.Show("分组性别设置不允许添加该组合项目!");
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
f = true;
|
|
}
|
|
break;
|
|
case 1:
|
|
if (xb == 0)
|
|
{
|
|
MessageBox.Show("分组性别设置不允许添加该组合项目!");
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
f = true;
|
|
}
|
|
break;
|
|
default:
|
|
f = true;
|
|
break;
|
|
}
|
|
|
|
switch (this.cbbhyzk.SelectedIndex)
|
|
{
|
|
case 0:
|
|
if (hyzk == 1)
|
|
{
|
|
MessageBox.Show("分组婚姻状况设置不允许添加该组合项目!");
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
f = true;
|
|
}
|
|
break;
|
|
case 1:
|
|
if (hyzk == 0)
|
|
{
|
|
MessageBox.Show("分组婚姻状况设置不允许添加该组合项目!");
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
f = true;
|
|
}
|
|
break;
|
|
default:
|
|
f = true;
|
|
break;
|
|
}
|
|
return f;
|
|
}
|
|
|
|
private void dataGridView2_DoubleClick(object sender, EventArgs e)
|
|
{
|
|
if (dataGridView2.CurrentRow.Index < 0)
|
|
{
|
|
return;
|
|
}
|
|
t_zhxm o = dataGridView2.Rows[dataGridView2.CurrentRow.Index].DataBoundItem as t_zhxm;
|
|
List<t_zhxm> al = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
bool f = true;
|
|
|
|
if (ceshiZhxm(o.xb, o.hyzk))
|
|
{
|
|
foreach (t_zhxm b in al)
|
|
{
|
|
if (b.zhbm != o.zhbm)
|
|
{
|
|
f = true;
|
|
}
|
|
else
|
|
{ f = false; return; }
|
|
}
|
|
if (f == true)
|
|
{
|
|
tzhxmBindingSource.Add(o);
|
|
};
|
|
|
|
List<t_zhxm> al1 = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al1)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString();
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
|
|
private void tbnlsx_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
base.m_textBox_KeyDown(sender, e);
|
|
}
|
|
|
|
private void tbnlsx_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
base.m_textBox_KeyPress(sender, e);
|
|
}
|
|
|
|
private void tbnlxx_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
base.m_textBox_KeyDown(sender, e);
|
|
}
|
|
|
|
private void tbnlxx_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
base.m_textBox_KeyPress(sender, e);
|
|
}
|
|
|
|
private void tbfzzl_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
base.m_textBox_KeyDown(sender, e);
|
|
}
|
|
|
|
private void tbfzzl_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
base.m_textBox_KeyPress(sender, e);
|
|
}
|
|
|
|
private void tbjxzl_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
base.m_textBox_KeyDown(sender, e);
|
|
}
|
|
|
|
private void tbjxzl_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
base.m_textBox_KeyPress(sender, e);
|
|
}
|
|
|
|
private void tbyjrs_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
base.m_textBox_KeyDown(sender, e);
|
|
}
|
|
|
|
private void tbyjrs_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
base.m_textBox_KeyPress(sender, e);
|
|
}
|
|
|
|
private void tbyjfy_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
base.m_textBox_KeyDown(sender, e);
|
|
}
|
|
|
|
private void tbyjfy_KeyPress(object sender, KeyPressEventArgs e)
|
|
{
|
|
base.m_textBox_KeyPress(sender, e);
|
|
}
|
|
|
|
private void tbssjg_TextChanged(object sender, EventArgs e)
|
|
{
|
|
List<t_zhxm> al1 = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al1)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString();
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
try
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
catch
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
}
|
|
public bool check()
|
|
{
|
|
if (tbddfzmc.Text == "")
|
|
{
|
|
MessageBox.Show("订单分组名称不能为空!");
|
|
return false;
|
|
}
|
|
if (tbnlsx.Text == "")
|
|
{
|
|
MessageBox.Show("年龄上限不能为空!");
|
|
return false;
|
|
}
|
|
if (tbnlxx.Text == "")
|
|
{
|
|
MessageBox.Show("年龄下限不能为空!");
|
|
return false;
|
|
}
|
|
if (tbfzjg.Text == "")
|
|
{
|
|
MessageBox.Show("合计价格不能为空!");
|
|
return false;
|
|
}
|
|
if (tbssjg.Text == "")
|
|
{
|
|
MessageBox.Show("实收价格不能为空!");
|
|
return false;
|
|
}
|
|
if (tbfzzl.Text == "")
|
|
{
|
|
MessageBox.Show("分组折率不能为空!");
|
|
return false;
|
|
}
|
|
if (tbjxzl.Text == "")
|
|
{
|
|
MessageBox.Show("加项折率不能为空!");
|
|
return false;
|
|
}
|
|
if (tbyjrs.Text == "")
|
|
{
|
|
MessageBox.Show("预计人数不能为空!");
|
|
return false;
|
|
}
|
|
if (tbyjfy.Text == "")
|
|
{
|
|
MessageBox.Show("预计费用不能为空!");
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
private void cbbxb_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
short xb = Convert.ToInt16(this.cbbxb.SelectedIndex);
|
|
List<t_zhxm> al = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
if (xb == 1)
|
|
{
|
|
al = (from x in al where x.xb != 0 select x).ToList();
|
|
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString();
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
tzhxmBindingSource.DataSource = al;
|
|
}
|
|
else
|
|
{
|
|
al = (from x in al where x.xb != 1 select x).ToList();
|
|
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString();
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
tzhxmBindingSource.DataSource = al;
|
|
}
|
|
|
|
}
|
|
|
|
private void cbbhyzk_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
short hyzk = Convert.ToInt16(this.cbbhyzk.SelectedIndex);
|
|
List<t_zhxm> al = ((System.Windows.Forms.BindingSource)(dataGridView1.DataSource)).List as List<t_zhxm>;
|
|
if (hyzk == 1)
|
|
{
|
|
al = (from x in al where x.hyzk != 0 select x).ToList();
|
|
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString();
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
tzhxmBindingSource.DataSource = al;
|
|
}
|
|
else
|
|
{
|
|
al = (from x in al where x.hyzk != 1 select x).ToList();
|
|
|
|
double zj = 0;
|
|
foreach (t_zhxm m in al)
|
|
{
|
|
zj += m.jg_v;
|
|
}
|
|
tbfzjg.Text = zj.ToString();
|
|
if (tbssjg.Text != "0")
|
|
{
|
|
tbfzzl.Text = Convert.ToInt32((Convert.ToDouble(tbssjg.Text) / Convert.ToDouble(tbfzjg.Text) * 100)).ToString();
|
|
}
|
|
else
|
|
{
|
|
tbfzzl.Text = "0";
|
|
}
|
|
tzhxmBindingSource.DataSource = al;
|
|
}
|
|
|
|
}
|
|
|
|
private void tb_tcZJM_KeyDown(object sender, KeyEventArgs e)
|
|
{
|
|
if (e.KeyCode == Keys.Enter)
|
|
{
|
|
Load_tab1_TC2(tb_tcZJM.Text.ToString());
|
|
}
|
|
}
|
|
|
|
//根据套餐名称检索
|
|
private void Load_tab1_TC2(string tcmc)
|
|
{
|
|
var vs = ServiceContainer.GetService<IQianTai2>();
|
|
List<t_tc> ltt = vs.GetTCByCondition(0, 0, fddm);
|
|
if (ltt != null)
|
|
{
|
|
this.cbjctc.DataSource = null;
|
|
var data = ltt.Where(t => t.tcmc.Contains(tcmc));
|
|
if (data.Any())
|
|
{
|
|
List<t_tc> newtc = data.ToList();
|
|
this.cbjctc.DataSource = newtc;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.cbjctc.DisplayMember = "tcmc";
|
|
this.cbjctc.ValueMember = "tcbm";
|
|
this.cbjctc.DataSource = ltt;
|
|
}
|
|
this.cbjctc.SelectedIndex = -1;
|
|
|
|
}
|
|
}
|
|
}
|