using LYFZ.BLL;
using LYFZ.ComponentLibrary;
using LYFZ.DAL;
using LYFZ.Model;
using LYFZ.Software.MainBusiness.Customers.OldCustomer;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace LYFZ.Software.MainBusiness.Customers
{
public partial class FrmOldCustomerRecordBaby : LYFZ.Software.UI.Customers.FrmOldCustomerRecordBaby
{
LYFZ.BLL.BLL_ErpSystemCategory scbll = new BLL.BLL_ErpSystemCategory();
LYFZ.Model.Model_ErpCustomer model = new Model.Model_ErpCustomer();
LYFZ.BLL.BLL_ErpOrder orbll = new BLL_ErpOrder();
LYFZ.BLL.BLL_ErpCustomer ctbll = new BLL_ErpCustomer();
LYFZ.BLL.BLL_OrderCustomer octbll = new BLL_OrderCustomer();
///
/// 订单编号
///
public string Theorderno;
///
/// 客户组编号
///
string Customergroup;
///
/// 宝宝ID
///
string BabyID = "";
///
/// 检查是否有修改
///
public bool IsSaved = false;
///
/// 客户组ID
///
public string GMID = "";
///
/// 首页联系人ID
///
public string oldID = "";
public FrmOldCustomerRecordBaby()
{
this.dgv2.CellDoubleClick += dgv2_CellDoubleClick;
this.chkLKH.Click += chkLKH_Click;
this.chkPYJS.Click += chkPYJS_Click;
this.chkQT.Click += chkQT_Click;
this.btnCustomerSource.Click += btnCustomerSource_Click;
this.btnRegion.Click += btnRegion_Click;
this.txtBaby_Birthday.Leave += txtBaby_Birthday_Leave;
this.btnQQCall.Click += btnQQCall_Click;
this.btnDial.Click += btnDial_Click;
this.txtCus_FixedPhone.KeyPress += txtCus_FixedPhone_KeyPress;
this.btnUnbind.Click += btnUnbind_Click;
}
///
/// 客户微信绑定
///
void BindMicroData(string customerID)
{
BLL_CustomerAndWxOpen bllWxOpen = new BLL_CustomerAndWxOpen();
DataTable dt = bllWxOpen.GetCustomerDataByCustomerID(customerID);
BLL.BLL_ErpMicroInterface bllInterface = new BLL.BLL_ErpMicroInterface();
LYFZ.Model.Model_ErpMicroInterface modInterFace = new Model.Model_ErpMicroInterface();
modInterFace = bllInterface.GetModelMicroInterface(LYFZ.BLL.BLL_ErpCompanyInfo.CurrentCompanyInfoID);
if (string.IsNullOrEmpty(modInterFace.AppID))
{
modInterFace.AppID = "";
}
DataRow[] drList = dt.Select(" APPID = '" + modInterFace.AppID + "' ");
if (drList.Length > 0)
{ this.txtMicroID.Text = "已绑定"; }
else
{ this.txtMicroID.Text = "未绑定"; }
}
///
/// 解除客户微信绑定
///
///
bool UnBindMicroData(string customerID)
{
BLL_CustomerAndWxOpen bllWxOpen = new BLL_CustomerAndWxOpen();
DataTable dt = bllWxOpen.GetCustomerDataByCustomerID(customerID);
BLL.BLL_ErpMicroInterface bllInterface = new BLL.BLL_ErpMicroInterface();
LYFZ.Model.Model_ErpMicroInterface modInterFace = new Model.Model_ErpMicroInterface();
modInterFace = bllInterface.GetModelMicroInterface(LYFZ.BLL.BLL_ErpCompanyInfo.CurrentCompanyInfoID);
if (string.IsNullOrEmpty(modInterFace.AppID))
{
modInterFace.AppID = "";
}
DataRow[] drList = dt.Select(" APPID = '" + modInterFace.AppID + "' ");
if (drList.Length > 0)
{
bllWxOpen.Delete(drList[0]["ID"]);
dt = bllWxOpen.GetCustomerDataByCustomerID(customerID);
string strOpenID = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
if (!string.IsNullOrEmpty(strOpenID))
{
strOpenID += "/";
}
strOpenID += dt.Rows[i]["APPID"] + ":" + dt.Rows[i]["WxOpenId"];
}
Model_ErpCustomer model = ctbll.GetModel(Convert.ToInt32(this.oldID));
model.Cus_OpenID = strOpenID;
ctbll.Update(model);
return true;
//this.txtMicroID.Text = "已绑定";
}
else
{
return false;
}
}
///
/// 窗体加载事件
///
///
///
protected override void FrmOldCustomerRecordBaby_Load(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtCus_Telephone);
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.HidePhoneControls(this.txtCus_FixedPhone);
this.btnUpdate.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersCustomerCompetence, CustomAttributes.OperatingAuthority.Update);
this.btnUnbind.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.MicroInfo, CustomAttributes.OperatingAuthority.MicroInfo_Unbind);
this.Text = "编辑";
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAC", this.cmbCus_Region, strHideFiled: "");
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbCus_CustomerSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD");
DataTable dt_tbl = scbll.GetList(" Sc_ClassParentID = '" + scbll.GetModel("BFABDBAJBJCEBDJCJ").ID.ToString().Trim() + "'").Tables[0];
for (int i = 0; i < dt_tbl.Rows.Count; i++)
{ this.cmbCus_Relations.Items.Add(dt_tbl.Rows[i]["Sc_ClassName"].ToString().Trim()); }
DataTable dt2 = orbll.GetView_Custom("tb_ErpCustomerGroup", StrWhere: "GP_OrderNumber = '" + Theorderno + "'", ShowColumnName: "GP_CustomerSource,GP_CustomerGroupID,GP_CustomerType").Tables[0];
if (dt2.Rows.Count > 0)
{
switch (dt2.Rows[0]["GP_CustomerSource"].ToString().Trim())
{
case "老客户":
this.chkLKH.Checked = true;
this.chkLKH_Click(null, null);
break;
case "朋友介绍":
this.chkPYJS.Checked = true;
this.chkPYJS_Click(null, null);
break;
default:
this.chkQT.Checked = true;
this.chkQT_Click(null, null);
this.cmbCus_CustomerSource.TextFindTag(dt2.Rows[0]["GP_CustomerSource"].ToString().Trim());
break;
}
this.dgv2.Rows.Clear();
this.Text = "编辑儿童客户";
this.Customergroup = dt2.Rows[0]["GP_CustomerGroupID"].ToString();
DataTable dt = orbll.GetView_Custom("tb_ErpCustomerGroupMembers Left Join tb_ErpCustomer on GM_CustomerID = Cus_CustomerNumber", StrWhere: "GM_CustomerGroupID = '" + Customergroup + "'", ShowColumnName: "tb_ErpCustomer.ID,Cus_Name,Cus_Sex,Cus_Birthday,Cus_BirthdayLunar,Cus_QQ,Cus_MicroSignal,Cus_Zodiac,Cus_DayForMarriage,Cus_DayForMarriageLunar,Cus_Telephone,Cus_FixedPhone,Cus_Region,Cus_Address,Cus_WorkUnit,Cus_CustomerNumber,Cus_Grade,Cus_Type,Cus_OpenID,GM_CustomerGroupID,GM_CustomerID,GM_RelatedPersonID,GM_Relation,tb_ErpCustomerGroupMembers.ID as GMID", filedOrder: "tb_ErpCustomer.ID").Tables[0];
bool IsTrue = false;
for (int t = 0; t < dt.Rows.Count; t++)
{
if (dt.Rows[t]["GM_Relation"].ToString().Trim() != "本人")
{
if (!IsTrue)
{
//性别
if (!Convert.ToBoolean(dt.Rows[t]["Cus_Sex"]))
{ this.radCus_Nan.Checked = true; }
else
{ radCus_Nv.Checked = true; }
//公历
if (dt.Rows[t]["Cus_BirthdayLunar"].ToString().Trim() == "1")
{ this.chkCus_Lunar.Checked = true; }
//客户组ID
this.GMID = dt.Rows[t]["GMID"].ToString().Trim();
//ID
this.oldID = dt.Rows[t]["ID"].ToString().Trim();
//获取姓名
this.txtCus_Name.Text = dt.Rows[t]["Cus_Name"].ToString().Trim();
//生日
this.txtCus_Birthday.StrValue = dt.Rows[t]["Cus_Birthday"].ToString().Trim();
//区域
this.cmbCus_Region.Text = dt.Rows[t]["Cus_Region"].ToString().Trim();
//手机
this.txtCus_Telephone.Text = dt.Rows[t]["Cus_Telephone"].ToString().Trim();
//固话
this.txtCus_FixedPhone.Text = dt.Rows[t]["Cus_FixedPhone"].ToString().Trim();
//QQ
this.txtCus_QQ.Text = dt.Rows[t]["Cus_QQ"].ToString().Trim();
//微信
this.txtCus_MicroSignal.Text = dt.Rows[t]["Cus_MicroSignal"].ToString().Trim();
//单位
this.txtCus_WorkUnit.Text = dt.Rows[t]["Cus_WorkUnit"].ToString().Trim();
//地址
this.txtCus_Address.Text = dt.Rows[t]["Cus_Address"].ToString().Trim();
//关系
this.cmbCus_Relations.Text = dt.Rows[t]["GM_Relation"].ToString().Trim();
BindMicroData(dt.Rows[t]["Cus_CustomerNumber"].ToString().Trim());
/*if (!string.IsNullOrEmpty(dt.Rows[t]["Cus_OpenID"].ToString().Trim()))
{ this.txtMicroID.Text = "已绑定"; }
else
{ this.txtMicroID.Text = "未绑定"; }
*/
//this.model.ID = Convert.ToInt32(dt.Rows[t]["ID"].ToString().Trim());
//this.CustomerNumber = dt.Rows[t]["GMID"].ToString().Trim();
IsTrue = true;
}
else
{
DataGridViewRow dgvr = new DataGridViewRow();
DataGridViewCell cell = null;
//姓名 0
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_Name"].ToString().Trim();
dgvr.Cells.Add(cell);
//性别 1
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_Sex"].ToString().Trim() == "False" ? "男" : "女";
dgvr.Cells.Add(cell);
//生日 2
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_Birthday"].ToString().Trim();
dgvr.Cells.Add(cell);
//生日历类 3
cell = new DataGridViewTextBoxCell();
cell.Value = Lunar(dt.Rows[t]["Cus_BirthdayLunar"].ToString().Trim());
dgvr.Cells.Add(cell);
//QQ 4
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_QQ"].ToString().Trim();
dgvr.Cells.Add(cell);
//微信 5
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_MicroSignal"].ToString().Trim();
dgvr.Cells.Add(cell);
//手机 6
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_Telephone"].ToString().Trim();
dgvr.Cells.Add(cell);
//固定电话 7
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_FixedPhone"].ToString().Trim();
dgvr.Cells.Add(cell);
//地区 8
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_Region"].ToString().Trim();
dgvr.Cells.Add(cell);
//地址 9
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_Address"].ToString().Trim();
dgvr.Cells.Add(cell);
//工作单位 10
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_WorkUnit"].ToString().Trim();
dgvr.Cells.Add(cell);
//ID 11
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["ID"].ToString().Trim();
dgvr.Cells.Add(cell);
//联系人 12
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["GM_Relation"].ToString().Trim();
dgvr.Cells.Add(cell);
//客户编号 14
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["Cus_CustomerNumber"].ToString().Trim();
dgvr.Cells.Add(cell);
//订单号 13
cell = new DataGridViewTextBoxCell();
cell.Value = dt.Rows[t]["GMID"].ToString().Trim();
dgvr.Cells.Add(cell);
this.dgv2.Rows.Add(dgvr);
}
}
else if (dt.Rows[t]["GM_Relation"].ToString().Trim() == "本人")
{
//宝宝ID
this.BabyID = dt.Rows[t]["ID"].ToString().Trim();
//宝贝姓名
this.txtBaby_name.Text = dt.Rows[t]["Cus_Name"].ToString();
//宝贝性别
if (!Convert.ToBoolean(dt.Rows[t]["Cus_Sex"]))
{ this.radCus_Nan.Checked = true; }
else
{ this.radioBaby_nv.Checked = true; }
//农历新历
string i = dt.Rows[t]["Cus_BirthdayLunar"].ToString();
if (dt.Rows[t]["Cus_BirthdayLunar"].ToString().Trim() == "1")
{ this.chkBaby_Lunar.Checked = true; }
//宝贝生日
this.txtBaby_Birthday.StrValue = dt.Rows[t]["Cus_Birthday"].ToString();
//宝宝生肖
this.cmbBaby.Text = dt.Rows[t]["Cus_Zodiac"].ToString();
}
}
}
else
{ MessageBoxCustom.Show("此订单没有用户"); }
}
///
/// 修改
///
///
///
protected override void btnUpdate_Click(object sender, EventArgs e)
{
List clist = new List();
string StrPhone = LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.MaskedTextBoxExGetText(this.txtCus_Telephone);
#region 验证输入框不能为空
if (string.IsNullOrEmpty(this.txtCus_Name.Text))
{ MessageBoxCustom.Show("客户姓名不能为空!"); return; }
if (this.txtCus_Telephone.Text == "")
{ MessageBoxCustom.Show("客户客户手机不能为空!"); return; }
if (!string.IsNullOrEmpty(StrPhone))
{
if (StrPhone.Length != 11)
{ MessageBoxCustom.Show("手机号码必须为11位数!"); return; }
DataTable tblClient = orbll.GetView_Custom("tb_ErpCustomer", StrWhere: "Cus_Telephone = '" + StrPhone + "' and ID != '" + this.oldID + "'", ShowColumnName: "ID").Tables[0];
if (tblClient.Rows.Count > 0)
{ MessageBoxCustom.Show("手机号已存在"); return; }
}
if (this.txtCus_Birthday.Text.Trim() != "")
{
int intMasse1 = this.txtCus_Birthday.CheckDateValue(this.txtCus_Birthday, this.chkCus_Lunar);
if (intMasse1 == 1) { MessageBoxCustom.Show("客户生日日期格式输入错误!"); return; }
else if (intMasse1 == 2)
{ MessageBoxCustom.Show("客户生日:" + this.txtCus_Birthday.StrValue.Trim() + "不是公历日期,若要保存请勾上农历!"); return; }
}
if (this.txtBaby_Birthday.Text.Trim() != "")
{
int intMasse = this.txtBaby_Birthday.CheckDateValue(this.txtBaby_Birthday, this.chkBaby_Lunar);
if (intMasse == 1) { MessageBoxCustom.Show("宝宝生日日期格式输入错误!"); return; }
else if (intMasse == 2)
{ MessageBoxCustom.Show("宝宝生日:" + this.txtBaby_Birthday.StrValue.Trim() + "不是公历日期,若要保存请勾上农历!"); return; }
}
if (this.chkLKH.Checked == false && this.chkQT.Checked == false && this.chkPYJS.Checked == false)
{
MessageBoxCustom.Show("请选择客户来源");
return;
}
if (this.cmbCus_Relations.Text == "")
{ MessageBoxCustom.Show("请选着与宝宝的关系"); return; }
#endregion
#region 修改客户资料
try
{
model = ctbll.GetModel(Convert.ToInt32(oldID));
model.Cus_Name = LYFZ.BLL.OtherCommonModel.ClearSpecialCharacter(this.txtCus_Name.Text.ToString());
model.Cus_NamePinyin = LYFZ.Command.Command_ChineseToPinyin.GetChineseSpellPinyin(model.Cus_Name).ToLower();
if (this.radCus_Nan.Checked)
{ model.Cus_Sex = false; }
else
{ model.Cus_Sex = true; }
model.Cus_Birthday = "";
model.Cus_BirthdayLunar = "";
model.Cus_Zodiac = "";
if (txtCus_Birthday.StrValue.Trim() != "")
{
model.Cus_Birthday = txtCus_Birthday.StrValue.Trim();
model.Cus_Zodiac = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac(this.txtCus_Birthday.StrValue.Trim(), this.chkCus_Lunar.Checked);
if (chkCus_Lunar.Checked)
{ model.Cus_BirthdayLunar = "1"; }
else
{ model.Cus_BirthdayLunar = "0"; }
}
model.Cus_QQ = this.txtCus_QQ.Text.ToString();
model.Cus_MicroSignal = this.txtCus_MicroSignal.Text.ToString();
model.Cus_Telephone = StrPhone;
model.Cus_FixedPhone = this.txtCus_FixedPhone.Text.ToString();
model.Cus_Region = this.cmbCus_Region.Text.ToString();
model.Cus_Address = this.txtCus_Address.Text.ToString();
model.Cus_WorkUnit = this.txtCus_WorkUnit.Text.ToString();
model.Cus_UpdateDateTime = SDateTime.Now;
model.Cus_UpdateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
//客人信息放入集合
clist.Add(ctbll.GetUpdateCommandInfo(model));
//获得宝宝信息
model = ctbll.GetModel(Convert.ToInt32(BabyID));
model.Cus_Name = txtBaby_name.Text;
model.Cus_Birthday = txtBaby_Birthday.StrValue.ToString();
if (model.Cus_Birthday != "")
{
if (chkBaby_Lunar.Checked)
{ model.Cus_BirthdayLunar = "1"; }
else { model.Cus_BirthdayLunar = "0"; }
model.Cus_Zodiac = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac(this.txtBaby_Birthday.StrValue.Trim(), this.chkBaby_Lunar.Checked);
}
else
{
model.Cus_BirthdayLunar = "";
model.Cus_Zodiac = "";
}
if (radioBaby_nan.Checked)
{ model.Cus_Sex = false; }
else
{ model.Cus_Sex = true; }
//宝宝数据
clist.Add(ctbll.GetUpdateCommandInfo(model));
//修改客户关系
BLL_ErpCustomerGroupMembers GMbll = new BLL_ErpCustomerGroupMembers();
Model.Model_ErpCustomerGroupMembers modelGM = GMbll.GetModel(Convert.ToInt32(GMID));
modelGM.GM_Relation = cmbCus_Relations.Text;
clist.Add(GMbll.GetUpdateCommandInfo(modelGM));
//修改客户来源
BLL_ErpCustomerGroup GPbll = new BLL_ErpCustomerGroup();
Model.Model_ErpCustomerGroup modelGP = GPbll.GetModel("GP_OrderNumber", Theorderno);
if (this.chkLKH.Checked)
{
modelGP.GP_CustomerSource = "老客户";
modelGP.GP_IntroducerCustomerID = "";
}
if (this.chkPYJS.Checked)
{ modelGP.GP_CustomerSource = "朋友介绍"; }
if (chkQT.Checked)
{
modelGP.GP_CustomerSource = cmbCus_CustomerSource.Text;
modelGP.GP_IntroducerCustomerID = "";
}
clist.Add(GPbll.GetUpdateCommandInfo(modelGP));
if (LYFZ.BLL.BaseBllOperate.ExecuteSqlTran(clist) > 0)
{
//日志
LYFZ.BLL.BLL_ErpSystemLogs.WriteSystemLog(LYFZ.EnumPublic.SystemLogsType.修改客户资料, "联系人:" + model.Cus_Name + ",修改联系人资料的客户组:" + modelGP.GP_CustomerGroupID + ",时间:" + SDateTime.Now, LYFZ.BLL.BLL_ErpUser.UsersModel.User_EmployeeID, LYFZ.BLL.BLL_ErpUser.UsersModel.User_Name);
DAL_ErpCustomer.UpdateAggregationCustomer(Theorderno);
MessageBoxCustom.Show("保存成功");
IsSaved = true;
}
else
{ MessageBoxCustom.Show("保存失败"); }
}
catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
#endregion
}
///
/// 解绑
///
///
///
void btnUnbind_Click(object sender, EventArgs e)
{
if (this.txtMicroID.Text.Trim() == "已绑定")
{
if (MessageBoxCustom.Show("是否要解除绑定?", "温馨提示!", MessageBoxButtons.YesNo) == DialogResult.No)
{ return; }
LYFZ.Model.Model_ErpCustomer model = ctbll.GetModel(Convert.ToInt32(this.oldID));
model.Cus_OpenID = "";
model.Cus_UpdateDateTime = SDateTime.Now;
model.Cus_UpdateName = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID;
ctbll.Update(model);
if (UnBindMicroData(model.Cus_CustomerNumber))
{
MessageBoxCustom.Show("解绑成功!");
this.txtMicroID.Text = "未绑定";
}
else
{ MessageBoxCustom.Show("解绑失败"); }
}
}
///
/// 列表双击事件
///
///
///
void dgv2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
try
{
if (this.dgv2.SelectedRows.Count > 0)
{
FrmAddContacts from = new FrmAddContacts();
from.btnSave.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.OrdersCustomerCompetence, CustomAttributes.OperatingAuthority.Update);
from.YouID = dgv2.CurrentRow.Cells["ID"].Value.ToString().Trim();
from.GP = Customergroup;
from.GMID = dgv2.CurrentRow.Cells["GMID"].Value.ToString().Trim();
from.Zhuangtai = "编辑";
if (from.ShowDialog() == DialogResult.OK)
{
this.IsSaved = true;
this.FrmOldCustomerRecordBaby_Load(null, null);
}
}
}
catch (Exception ex)
{ MessageBoxCustom.Show(ex.Message); }
}
///
/// 打电话
///
///
///
void btnDial_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.PhoneCall(this.txtCus_Telephone);
}
///
/// QQ呼叫
///
///
///
void btnQQCall_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.QQCall(this.txtCus_QQ.Text.Trim());
}
///
/// 生日离开验证
///
///
///
void txtBaby_Birthday_Leave(object sender, EventArgs e)
{
this.cmbBaby.Text = LYFZ.Command.Command_CalendarTurnLunar.GetZodiac(this.txtBaby_Birthday.StrValue.Trim(), this.chkBaby_Lunar.Checked);
}
///
/// 关闭
///
///
///
protected override void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
///
/// 设置客户来源
///
///
///
void btnCustomerSource_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
frm.TypeName = "AAAAAAF";
frm.Version = "Version";
if (frm.ShowDialog() == DialogResult.OK)
{ LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAF", this.cmbCus_CustomerSource, strHideFiled: "BFACBABGBGBJGDHIE,BFAFBCBADBDCABFDD"); }
}
///
/// 设置客户区域
///
///
///
void btnRegion_Click(object sender, EventArgs e)
{
LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet frm = new InitialSet.FrmSystemSet();
frm.TypeName = "AAAAAAC";
frm.Version = "Version";
if (frm.ShowDialog() == DialogResult.OK)
{ LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_ClientSourec("AAAAAAC", this.cmbCus_Region, strHideFiled: ""); }
}
///
/// 单选框事件
///
///
///
void chkQT_Click(object sender, EventArgs e)
{
this.chkLKH.Checked = false;
this.chkPYJS.Checked = false;
this.cmbCus_CustomerSource.Enabled = true;
}
///
/// 单选框事件
///
///
///
void chkPYJS_Click(object sender, EventArgs e)
{
this.cmbCus_CustomerSource.Enabled = false;
this.chkLKH.Checked = false;
this.chkQT.Checked = false;
}
///
/// 单选框事件
///
///
///
void chkLKH_Click(object sender, EventArgs e)
{
this.chkPYJS.Checked = false;
this.chkQT.Checked = false;
this.cmbCus_CustomerSource.Enabled = false;
}
///
/// 输入框设置
///
///
///
void txtCus_FixedPhone_KeyPress(object sender, KeyPressEventArgs e)
{
if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
{ e.Handled = true; }
}
///
/// 输入框设置
///
///
///
protected override void txtCus_QQ_KeyPress(object sender, KeyPressEventArgs e)
{
if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
{ e.Handled = true; }
}
///
/// 输入框设置
///
///
///
protected override void txtCus_Telephone_KeyPress(object sender, KeyPressEventArgs e)
{
if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
{ e.Handled = true; }
}
///
/// 返回日历类别
///
///
///
string Lunar(string lun)
{
string luns = "";
switch (lun)
{
case "0":
luns = "公历";
break;
case "1":
luns = "农历";
break;
case "2":
luns = "农历润月";
break;
}
return luns;
}
}
}