添加联系人的后台代码:
protected void btnSubmit_Click(object sender, EventArgs e)
{
BioErpCrmManageChannel channel = new BioErpCrmManageChannel()
{
ChannelName = this.txtChannelName.Text,
AccountName = this.txtBank.Text,
Accounts = this.txtAccounts.Text,
Address = this.txtAddress.Text,
Areal = this.ddlArea.SelectedItem.Text,
ChannelLevel = this.ddlLevel.Text,
ChannelSize = this.ddlChannelSize.SelectedItem.Text,
ChannelType = this.ddlType.Text,
City = this.ddlCity.SelectedItem.Text,
Province = this.ddlProvince.SelectedItem.Text,
CoreOperttion = this.txtCoreOperttion.Text,
Tel1 = this.txtTel1.Text,
Tel2 = this.txtTel2.Text,
TaxNumber = this.txtTaxNumber.Text,
CoSummary = this.txtCoSummary.Text,
Email = this.txtEmail.Text,
Fax = this.txtFax.Text,
NetAddress = this.txtNextTime.Text,
Vocation = this.ddlVocation.SelectedItem.Text,
SuperiorChannel = this.txtSuperChannelID.Text == "" ? 0 : int.Parse(this.txtSuperChannelID.Text),
UserID = int.Parse(this.txtUserName.Text),
NextContactTime = Convert.ToDateTime(this.txtNextTime.Text),
Status = this.ddlState.SelectedItem.Text,
CreditStanding = this.txtCredit.Text,
EnrollTime = Convert.ToDateTime(this.txtRegisterTime.Text)
};
BioErpCrmManageChannelBLL channelbll = new BioErpCrmManageChannelBLL();
BioErpCrmChannelLinkManBLL linkmanbll = new BioErpCrmChannelLinkManBLL();
int channelid = channelbll.BioErpCrmManageChannelAdd(channel);
//渠道基本信息添加成功,才能添加联系人基本信息
if (channelid != 0)
{
string linkman = Request["txtLinkMan1"].ToString();
string ddlSex = Request["ddlSex1"].ToString();
string Birthday = Request["txtBirthday1"].ToString();
string MainLink = Request["ddlMainLink1"].ToString();
string OfficePhone = Request["txtOfficePhone"].ToString();
string Mobile = Request["txtOfficePhone"].ToString();
string Email = Request["txtEmail11"].ToString();
string Address = Request["txtAddress1"].ToString();
string QQ = Request["txtQQ1"].ToString();
string Remark = Request["txtRemark1"].ToString();
string[] linkmans = linkman.Split(',');
string[] ddlSexs = ddlSex.Split(',');
string[] Birthdays = Birthday.Split(',');
string[] MainLinks = MainLink.Split(',');
string[] OfficePhones = OfficePhone.Split(',');
string[] Mobiles = Mobile.Split(',');
string[] Emails = Email.Split(',');
string[] Addresses = Address.Split(',');
string[] QQs = QQ.Split(',');
string[] Remarks = Remark.Split(',');
BioErpCrmChannelLinkMan linkmanobj = null;
for (int i = 0; i < linkmans.Length; i++)
{
linkmanobj = new BioErpCrmChannelLinkMan()
{
LinkmanName = linkmans[i],
Address = Addresses[i],
Email = Emails[i],
Remark = Remarks[i],
Sex = ddlSexs[i] == "0" ? false : true,
QQ = QQs[i].ToString(),
OfficialPhone = OfficePhones[i],
MobilePhone = Mobiles[i],
Birthday = Convert.ToDateTime(Birthdays[i]),
ChannelID = channelid,
IsMainLinkman = MainLinks[i] == "0" ? false : true
};
linkmanbll.BioErpCrmChannelLinkManADD(linkmanobj);
}
}
}
protected void btnSubmit_Cli