/// <summary>
 /// 刪除會員
 /// </summary>
 /// <param name="member">被刪除的會員</param>
 public void DeleteMember(Member member)
 {
     FTISDao.DeleteMember(member);
 }
 /// <summary>
 /// 更新會員
 /// </summary>
 /// <param name="member">被更新的會員</param>
 /// <returns>更新後的會員</returns>
 public Member UpdateMember(Member member)
 {
     return FTISDao.UpdateMember(member);
 }
 /// <summary>
 /// 會員
 /// </summary>
 /// <param name="member">被新增的會員</param>
 /// <returns>新增後的會員</returns>
 public Member CreateMember(Member member)
 {
     return FTISDao.CreateMember(member);
 }
        private void Save(Member entity)
        {
            entity.MemberId = EntityId;
            entity.Name = Name;
            entity.LoginId = LoginId;
            entity.Password = Password;
            entity.Company = Company;
            entity.Status = Status;
            entity.RegDate = RegDate;
            entity.CompanyNo = CompanyNo;
            entity.CompanyNum = CompanyNum;
            entity.CompanyType = CompanyType;
            entity.CompanyTypeOther = CompanyTypeOther;
            entity.Email = Email;
            entity.Contact = Contact;
            entity.Dept = Dept;
            entity.JobTitle = JobTitle;
            entity.Tel = Tel;
            entity.Tel2 = Tel2;
            entity.Fax = Fax;
            entity.Content = Content;
            entity.ReceiveEpaperInfo = ReceiveEpaperInfo;
            if (IndustryId > 0)
            {
                entity.Industry = m_FTISService.GetIndustryById(IndustryId);
            }

            if (CompanyTypeList != null && CompanyTypeList.Count() > 0)
            {
                entity.CompanyType = String.Join(", ", CompanyTypeList);
            }
            else
            {
                entity.CompanyType = string.Empty;
            }

            if (entity.MemberId == 0)
            {
                entity.RegDate = DateTime.Now;
                m_FTISService.CreateMember(entity);
            }
            else
            {
                m_FTISService.UpdateMember(entity);
            }

            LoadEntity(entity.MemberId);
        }
 public void Insert()
 {
     Member entity = new Member();
     Save(entity);
 }
 protected void LoadEntity(Member entity)
 {
     if (entity != null)
     {
         EntityId = entity.MemberId;
         Name = entity.Name;
         LoginId = entity.LoginId;
         Password = entity.Password;
         Company = entity.Company;
         Status = entity.Status;
         RegDate = entity.RegDate;
         CompanyNo = entity.CompanyNo;
         CompanyNum = entity.CompanyNum;
         CompanyType = entity.CompanyType;
         CompanyTypeOther = entity.CompanyTypeOther;
         Email = entity.Email;
         Contact = entity.Contact;
         Dept = entity.Dept;
         JobTitle = entity.JobTitle;
         Tel = entity.Tel;
         Tel2 = entity.Tel2;
         Fax = entity.Fax;
         Content = entity.Content;
         IndustryId = entity.Industry.IndustryId;
         ReceiveEpaperInfo = entity.ReceiveEpaperInfo;
         CompanyTypeList = entity.CompanyType.Replace(", ", ",").Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
     }
 }