public Enterprice GetEnterpriceID(string email)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en = factory.getEnterpriseInstance();
     Enterprice enterprice  = en.GetEnterpriceID(email);
     return enterprice;
 }
Beispiel #2
0
        public Enterprice GetEnterpriceID(string email)
        {
            OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.EnterpriseInfoIDAL en      = factory.getEnterpriseInstance();
            Enterprice enterprice = en.GetEnterpriceID(email);

            return(enterprice);
        }
Beispiel #3
0
        public int SendResetEmail(string email)
        {
            OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL           dalad   = factory.getUserInstance();
            OxcoderIDAL.EnterpriseInfoIDAL en      = factory.getEnterpriseInstance();
            // dalad.SendEmail(id, md5);
            //TODO:发邮件
            MailMessage mailMsg = new MailMessage();

            mailMsg.From = new MailAddress("*****@*****.**");
            mailMsg.To.Add(email);
            mailMsg.Subject = "请重置密码";
            string        activeCode     = Guid.NewGuid().ToString().Substring(0, 8);
            StringBuilder contentBuilder = new StringBuilder();

            contentBuilder.Append("请点击下面的链接完成密码重置");
            contentBuilder.Append("<a href='http://*****:*****@qq.com", "hmh299222");
            int state = 0;

            //判断用户类型
            if (dalad.CheckUserEmail(email) == 1)
            {
                if (dalad.SendUserEmail(email, activeCode) != 0)
                {
                    client.Send(mailMsg);
                    state = 1;
                }
                else
                {
                    state = 0;
                }
            }
            else if (en.CheckEnterpriceEmail(email) == 1)
            {
                if (en.SendEnterpriceEmail(email, activeCode) != 0)
                {
                    client.Send(mailMsg);
                    state = 1;
                }
                else
                {
                    state = 0;
                }
            }
            return(state);
        }
Beispiel #4
0
 public Boolean EnterpriceLogin(String email, String password)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     Model.Enterprice enterprice            = new Model.Enterprice();
     enterprice = dalad.EnterpriceLogin(email);
     if (enterprice.Enterprice_Password.Equals(password) && enterprice.Enterprice_State.Equals("1"))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public Boolean EnterpriceLogin(String email, String password)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     Model.Enterprice enterprice = new Model.Enterprice();
     enterprice = dalad.EnterpriceLogin(email);
     if (enterprice.Enterprice_Password.Equals(password)&&enterprice.Enterprice_State.Equals("1"))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Beispiel #6
0
 public int RegisterUser(string email, string password)
 {
     OxcoderIFactory.IFactory       factory    = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.UserIDAL           dalad      = factory.getUserInstance();
     OxcoderIDAL.EnterpriseInfoIDAL enterprice = factory.getEnterpriseInstance();
     Model.User user = new Model.User();
     user.User_ID       = Guid.NewGuid().ToString();
     user.User_Email    = email;
     user.User_Password = password;
     if (dalad.CheckUserEmail(email) == 0 && enterprice.CheckEnterpriceEmail(email) == 0)
     {
         return(dalad.RegisterUser(user));
     }
     else
     {
         return(0);
     }
 }
        public Boolean ActiveEnterpriceAccount(string email, string activeCode)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
            SqlDataReader rd = dalad.ActiveEnterpriceAccount(email);
              string activeCode2=null;
            if (rd.Read()) {
             activeCode2 = rd["Enterprice_Md5"].ToString();
            }

            if (activeCode.Equals(activeCode2) && dalad.ChangeEnterpriceState(email) == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Beispiel #8
0
        public Boolean ActiveEnterpriceAccount(string email, string activeCode)
        {
            OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
            SqlDataReader rd          = dalad.ActiveEnterpriceAccount(email);
            string        activeCode2 = null;

            if (rd.Read())
            {
                activeCode2 = rd["Enterprice_Md5"].ToString();
            }

            if (activeCode.Equals(activeCode2) && dalad.ChangeEnterpriceState(email) == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #9
0
        public int SendEnterpriceEmail(string emailTo)
        {
            OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
            // dalad.SendEmail(id, md5);
            //TODO:发邮件
            MailMessage mailMsg = new MailMessage();

            mailMsg.From = new MailAddress("*****@*****.**");
            mailMsg.To.Add(emailTo);
            mailMsg.Subject = "请激活注册账号";
            string        activeCode     = Guid.NewGuid().ToString().Substring(0, 8);
            StringBuilder contentBuilder = new StringBuilder();

            contentBuilder.Append("请点击下面的链接完成激活注册");
            string type = "Enterprice";

            contentBuilder.Append("<a href='http://*****:*****@qq.com", "hmh299222");
            if (dalad.SendEnterpriceEmail(emailTo, activeCode) != 0)
            {
                client.Send(mailMsg);
                return(1);
            }
            else
            {
                return(0);
            }
        }
Beispiel #10
0
        public int SendResetEmail(string email)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL dalad = factory.getUserInstance();
            OxcoderIDAL.EnterpriseInfoIDAL en = factory.getEnterpriseInstance();
            // dalad.SendEmail(id, md5);
            //TODO:发邮件
            MailMessage mailMsg = new MailMessage();
            mailMsg.From = new MailAddress("*****@*****.**");
            mailMsg.To.Add(email);
            mailMsg.Subject = "请重置密码";
            string activeCode = Guid.NewGuid().ToString().Substring(0, 8);
            StringBuilder contentBuilder = new StringBuilder();
            contentBuilder.Append("请点击下面的链接完成密码重置");
            contentBuilder.Append("<a href='http://*****:*****@qq.com", "hmh299222");
            int state = 0;
            //判断用户类型
            if (dalad.CheckUserEmail(email) == 1)
            {
                if (dalad.SendUserEmail(email, activeCode) != 0)
                {
                    client.Send(mailMsg);
                    state = 1;
                }
                else
                {
                    state = 0;

                }
            }else if(en.CheckEnterpriceEmail(email) == 1){
                if (en.SendEnterpriceEmail(email, activeCode) != 0)
                {
                    client.Send(mailMsg);
                    state = 1;
                }
                else
                {
                    state = 0;

                }
            }
            return state;
        }
Beispiel #11
0
 public int SetPassword(string email, string newPwd)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     return dalad.SetPassword(email, newPwd);
 }
Beispiel #12
0
 public DataSet EnterpriceInfo(string id)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en      = factory.getEnterpriseInstance();
     return(en.EnterpriceInfo(id));
 }
Beispiel #13
0
 public int UpdateEnterpriceInfo(string fullName,string enterpricePhone,string email)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     return dalad.UpdateEnterpriceInfo(fullName,enterpricePhone,email);
 }
Beispiel #14
0
 public int UpdateEnterpriceInfo1(string position, string email)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     return(dalad.UpdateEnterpriceInfo1(position, email));
 }
Beispiel #15
0
 public DataSet AllEnterpriseInfo()
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en      = factory.getEnterpriseInstance();
     return(en.AllEnterpriseInfo());
 }
Beispiel #16
0
 public int UpdateEnterpriceInfo(string fullName, string enterpricePhone, string email)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     return(dalad.UpdateEnterpriceInfo(fullName, enterpricePhone, email));
 }
Beispiel #17
0
 public int UpdateEnterpriceInfo0(Enterprice enterprice)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     return(dalad.UpdateEnterpriceInfo0(enterprice));
 }
Beispiel #18
0
 public int UpdateEnterpriceInfo0(Enterprice enterprice)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     return dalad.UpdateEnterpriceInfo0(enterprice);
 }
Beispiel #19
0
 public int SetPassword(string email, string newPwd)
 {
     OxcoderIFactory.IFactory       factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad   = factory.getEnterpriseInstance();
     return(dalad.SetPassword(email, newPwd));
 }
Beispiel #20
0
 public int SendEnterpriceEmail(string emailTo)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     // dalad.SendEmail(id, md5);
     //TODO:发邮件
     MailMessage mailMsg = new MailMessage();
     mailMsg.From = new MailAddress("*****@*****.**");
     mailMsg.To.Add(emailTo);
     mailMsg.Subject = "请激活注册账号";
     string activeCode = Guid.NewGuid().ToString().Substring(0, 8);
     StringBuilder contentBuilder = new StringBuilder();
     contentBuilder.Append("请点击下面的链接完成激活注册");
     string type = "Enterprice";
     contentBuilder.Append("<a href='http://*****:*****@qq.com", "hmh299222");
     if (dalad.SendEnterpriceEmail(emailTo, activeCode) != 0)
     {
         client.Send(mailMsg);
         return 1;
     }
     else
     {
         return 0;
     }
 }
Beispiel #21
0
        public int RegisterEnterprice(string email, string password)
        {
            OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
            OxcoderIDAL.UserIDAL user = factory.getUserInstance();
            OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
            Model.Enterprice enterprice = new Model.Enterprice();
            enterprice.Enterprice_ID = Guid.NewGuid().ToString();
            enterprice.Enterprice_Email = email;
            enterprice.Enterprice_Password = password;
            if (dalad.CheckEnterpriceEmail(email) == 0 && user.CheckUserEmail(email)==0)
            {
                return dalad.RegisterEnterprice(enterprice);
            }
            else
            {

                return 0;
            }
        }
Beispiel #22
0
 public int UpdateEnterpriceInfo1(string position,string email)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance();
     return dalad.UpdateEnterpriceInfo1(position, email);
 }
Beispiel #23
0
 public DataSet AllEnterpriseInfo()
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en = factory.getEnterpriseInstance();
     return en.AllEnterpriseInfo();
 }
Beispiel #24
0
 public DataSet EnterpriceInfo(string id)
 {
     OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory();
     OxcoderIDAL.EnterpriseInfoIDAL en = factory.getEnterpriseInstance();
     return en.EnterpriceInfo(id);
 }