public Company CreateCompany(CompanyBean bean)
        {
            Company beanBack = new Company();

            beanBack.CompanyId    = bean.CompanyId;
            beanBack.CompanyName  = bean.CompanyName;
            beanBack.Contacts     = bean.Contacts;
            beanBack.Phone        = bean.Phone;
            beanBack.Mobile       = bean.Mobile;
            beanBack.Email        = bean.Email;
            beanBack.Addr         = bean.Addr;
            beanBack.Logo1        = bean.Logo1;
            beanBack.Logo2        = bean.Logo2;
            beanBack.DPName       = bean.DPName;
            beanBack.DPAddr       = bean.DPAddr;
            beanBack.DPParam      = bean.DPParam;
            beanBack.CreateTime   = bean.CreateTime;
            beanBack.CreatePerson = bean.CreatePerson;
            beanBack.EditTime     = bean.EditTime;
            beanBack.EditPerson   = bean.EditPerson;
            beanBack.Deleted      = bean.Deleted;
            return(beanBack);
        }
        public Boolean Verification(CompanyBean bean)
        {
            Boolean flag             = false;
            var     regexTelephone   = new Regex(@"^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$");
            var     regexMobilePhone = new Regex(@"^[1][358]\d{9}$");
            String  strExp           = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";


            if (!string.IsNullOrWhiteSpace(bean.Phone))
            {
                if (!regexTelephone.IsMatch(bean.Phone) && !regexMobilePhone.IsMatch(bean.Phone))
                {
                    MessageBox.Show("请填写正确的电话号码!");
                    return(flag);
                }
            }

            if (!string.IsNullOrWhiteSpace(bean.Mobile))
            {
                if (!regexMobilePhone.IsMatch(bean.Mobile))
                {
                    MessageBox.Show("请填写正确的手机号码!");
                    return(flag);
                }
            }
            if (!string.IsNullOrWhiteSpace(bean.Email))
            {
                Regex r = new Regex(strExp);
                Match m = r.Match(bean.Email);
                if (!m.Success)
                {
                    MessageBox.Show("请填写正确的邮箱地址!");
                    return(flag);
                }
            }
            return(true);
        }
        public Boolean Verification(CompanyBean bean)
        {
            Boolean flag = false;
            var regexTelephone = new Regex(@"^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$");
            var regexMobilePhone = new Regex(@"^[1][358]\d{9}$");
            String strExp = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";
               
               
                if (!string.IsNullOrWhiteSpace(bean.Phone)) {
                    if (!regexTelephone.IsMatch(bean.Phone) && !regexMobilePhone.IsMatch(bean.Phone))
                    {
                         MessageBox.Show("请填写正确的电话号码!");
                        return flag;
                    }
                }

                if (!string.IsNullOrWhiteSpace(bean.Mobile)) {
                    if (!regexMobilePhone.IsMatch(bean.Mobile))
                    {
                        MessageBox.Show("请填写正确的手机号码!");
                        return flag;
                    }
                }
                if (!string.IsNullOrWhiteSpace(bean.Email))
                {
                    Regex r = new Regex(strExp);
                    Match m = r.Match(bean.Email);
                    if (!m.Success)
                    {
                        MessageBox.Show("请填写正确的邮箱地址!");
                        return flag;
                    }
                }
             return true;
        }
        public Company CreateCompany(CompanyBean bean)
        {
            Company beanBack = new Company();
            beanBack.CompanyId = bean.CompanyId;
            beanBack.CompanyName = bean.CompanyName;
            beanBack.Contacts = bean.Contacts;
            beanBack.Phone = bean.Phone;
            beanBack.Mobile = bean.Mobile;
            beanBack.Email = bean.Email;
            beanBack.Addr = bean.Addr;
            beanBack.Logo1 = bean.Logo1;
            beanBack.Logo2 = bean.Logo2;
            beanBack.DPName = bean.DPName;
            beanBack.DPAddr = bean.DPAddr;
            beanBack.DPParam = bean.DPParam;
            beanBack.CreateTime = bean.CreateTime;
            beanBack.CreatePerson = bean.CreatePerson;
            beanBack.EditTime = bean.EditTime;
            beanBack.EditPerson = bean.EditPerson;
            beanBack.Deleted = bean.Deleted;
            return beanBack;

        }