📄 contactershow.cs
字号:
namespace PowerEasy.WebSite.Admin.Crm
{
using PowerEasy.AccessManage;
using PowerEasy.Accessories;
using PowerEasy.Components;
using PowerEasy.Controls;
using PowerEasy.Crm;
using PowerEasy.Enumerations;
using PowerEasy.ExtendedControls;
using PowerEasy.Model.Accessories;
using PowerEasy.Model.Crm;
using PowerEasy.Web.UI;
using System;
using System.Web.UI.WebControls;
public class ContacterShow : AdminPage
{
protected ExtendedButton BtnModify;
private int contacterId;
protected Label LblAddress;
protected Label LblAim;
protected Label LblBirthday;
protected Label LblCity;
protected Label LblClientId;
protected Label LblCountry;
protected Label LblDepartment;
protected Label LblEducation;
protected Label LblEmail;
protected Label LblFamily;
protected Label LblFax;
protected Label LblGraduateFrom;
protected Label LblHomepage;
protected Label LblHomePhone;
protected Label LblICQ;
protected Label LblIDCard;
protected Label LblIncome;
protected Label LblInterestsOfAmusement;
protected Label LblInterestsOfCulture;
protected Label LblInterestsOfLife;
protected Label LblInterestsOfOther;
protected Label LblInterestsOfSport;
protected Label LblMarriage;
protected Label LblMobile;
protected Label LblMSN;
protected Label LblNation;
protected Label LblNativePlace;
protected Label LblOfficePhone;
protected Label LblOperation;
protected Label LblParenterId;
protected Label LblPHS;
protected Label LblPosition;
protected Label LblProvince;
protected Label LblQQ;
protected Label LblSex;
protected Label LblTitle;
protected Label LblTrueName;
protected Label LblUC;
protected Label LblUserType;
protected Label LblYahoo;
protected Label LblZipCode;
protected ExtendedSiteMapPath SmpNavigator;
protected void BtnSave_Click(object sender, EventArgs e)
{
BasePage.ResponseRedirect("Contacter.aspx?Action=Modify&ContacterId=" + this.contacterId);
}
protected void EvaluateToLabel()
{
ContacterInfo contacterById = Contacter.GetContacterById(this.contacterId);
this.LblClientId.Text = Client.GetClientNameById(contacterById.ClientId);
ContacterInfo info2 = Contacter.GetContacterById(contacterById.ParentId);
if (!info2.IsNull)
{
this.LblParenterId.Text = info2.TrueName;
}
this.LblTrueName.Text = contacterById.TrueName;
this.LblTitle.Text = contacterById.Title;
this.LblCountry.Text = contacterById.Country;
this.LblProvince.Text = contacterById.Province;
this.LblCity.Text = contacterById.City;
if (contacterById.UserType == ContacterType.EnterpriceMainContacter)
{
this.LblUserType.Text = "主联系人";
}
else
{
this.LblUserType.Text = "其它联系人";
}
this.LblZipCode.Text = contacterById.ZipCode;
this.LblAddress.Text = contacterById.Address;
this.LblOfficePhone.Text = contacterById.OfficePhone;
this.LblHomePhone.Text = contacterById.HomePhone;
this.LblMobile.Text = contacterById.Mobile;
this.LblFax.Text = contacterById.Fax;
this.LblPHS.Text = contacterById.Phs;
this.LblHomepage.Text = contacterById.Homepage;
this.LblEmail.Text = contacterById.Email;
this.LblQQ.Text = contacterById.QQ;
this.LblMSN.Text = contacterById.Msn;
this.LblICQ.Text = contacterById.Icq;
this.LblYahoo.Text = contacterById.Yahoo;
this.LblUC.Text = contacterById.UC;
this.LblAim.Text = contacterById.Aim;
if (contacterById.Birthday.HasValue)
{
this.LblBirthday.Text = contacterById.Birthday.Value.ToString("yyyy-MM-dd");
}
this.LblIDCard.Text = contacterById.IdCard;
this.LblNativePlace.Text = contacterById.NativePlace;
this.LblNation.Text = contacterById.Nation;
this.LblSex.Text = BasePage.EnumToHtml<UserSexType>(contacterById.Sex);
this.LblMarriage.Text = BasePage.EnumToHtml<UserMarriageType>(contacterById.Marriage);
this.LblEducation.Text = this.GetDataText("PE_Contacter", "Education", contacterById.Education);
this.LblGraduateFrom.Text = contacterById.GraduateFrom;
this.LblInterestsOfLife.Text = contacterById.InterestsOfLife;
this.LblInterestsOfCulture.Text = contacterById.InterestsOfCulture;
this.LblInterestsOfAmusement.Text = contacterById.InterestsOfAmusement;
this.LblInterestsOfSport.Text = contacterById.InterestsOfSport;
this.LblInterestsOfOther.Text = contacterById.InterestsOfOther;
this.LblIncome.Text = this.GetDataText("PE_Contacter", "Income", contacterById.Income);
this.LblDepartment.Text = contacterById.Department;
this.LblPosition.Text = contacterById.Position;
this.LblOperation.Text = contacterById.Operation;
this.LblFamily.Text = contacterById.Family;
if ((contacterById.Owner == PEContext.Current.Admin.AdminName) && RolePermissions.AccessCheck(OperateCode.ContacterModifyOwn))
{
this.BtnModify.Enabled = true;
}
}
private string GetDataText(string tableName, string fieldName, int dataValueField)
{
foreach (ChoicesetValueInfo info in Choiceset.GetDictionaryFieldValueByName(tableName, fieldName))
{
if (info.DataValueField == dataValueField)
{
return info.DataTextField;
}
}
return "";
}
protected void Page_Load(object sender, EventArgs e)
{
this.contacterId = BasePage.RequestInt32("contacterId");
if (!base.IsPostBack)
{
this.EvaluateToLabel();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -