protected void Page_Load(object sender, EventArgs e) { string email = Request.QueryString["email"].ToString(); string activeCode = Request["activeCode"].ToString(); Model.User user = User.GetUserID(email); Session["email"] = email; Model.Enterprice enterprice = Enterprice.GetEnterpriceID(email); string password = enterprice.Enterprice_Password; if (user.User_ID != null) { if (User.ActiveUserAccount(email, activeCode)) { Response.Redirect("Reset_Password.aspx"); } } else if (enterprice.Enterprice_ID != null) { if (Enterprice.ActiveEnterpriceAccount(email, activeCode)) { Response.Redirect("Reset_Password.aspx"); } } }
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; } }
public int RegisterEnterprice(Model.Enterprice enterprice) { StringBuilder sql = new StringBuilder(); sql.Append("insert into [Enterprice](Enterprice_ID,Enterprice_Email,Enterprice_Password,Enterprice_FullName) values(@id,@email,@password,@username)"); SqlParameter[] par = { new SqlParameter("@id", SqlDbType.VarChar, 50), new SqlParameter("@email", SqlDbType.Text), new SqlParameter("@password", SqlDbType.Text), new SqlParameter("@username", SqlDbType.Text) }; par[0].Value = enterprice.Enterprice_ID; par[1].Value = enterprice.Enterprice_Email; par[2].Value = enterprice.Enterprice_Password; par[3].Value = enterprice.Enterprice_Email; return(Common.DbHelperSQL.ExecuteSql(sql.ToString(), par)); }
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); } }
public Enterprice EnterpriceLogin(string email) { StringBuilder sql = new StringBuilder(); sql.Append("select Enterprice_Password,Enterprice_State from [Enterprice] where Enterprice_Email like @email"); SqlParameter[] par = { new SqlParameter("@email", SqlDbType.VarChar) }; par[0].Value = email; SqlDataReader rd = Common.DbHelperSQL.ExecuteReader(sql.ToString(), par); Model.Enterprice enterprice = new Model.Enterprice(); if (rd.Read()) { enterprice.Enterprice_Password = rd["Enterprice_Password"].ToString(); enterprice.Enterprice_State = rd["Enterprice_State"].ToString(); } return(enterprice); }
public Enterprice GetEnterpriceID(string email) { StringBuilder sql = new StringBuilder(); sql.Append("select Enterprice_ID,Enterprice_FullName from [Enterprice] where Enterprice_Email like @email"); SqlParameter[] par ={ new SqlParameter("@email",SqlDbType.Text) }; par[0].Value = email; SqlDataReader rd = Common.DbHelperSQL.ExecuteReader(sql.ToString(), par); Enterprice enterprice = new Enterprice(); if (rd.Read()) { enterprice.Enterprice_ID = rd["Enterprice_ID"].ToString(); enterprice.Enterprice_FullName = rd["Enterprice_FullName"].ToString(); } return enterprice; }
public Enterprice EnterpriceLogin(string email) { StringBuilder sql = new StringBuilder(); sql.Append("select Enterprice_Password,Enterprice_State from [Enterprice] where Enterprice_Email like @email"); SqlParameter[] par ={ new SqlParameter("@email",SqlDbType.VarChar) }; par[0].Value = email; SqlDataReader rd = Common.DbHelperSQL.ExecuteReader(sql.ToString(), par); Model.Enterprice enterprice = new Model.Enterprice(); if (rd.Read()) { enterprice.Enterprice_Password = rd["Enterprice_Password"].ToString(); enterprice.Enterprice_State = rd["Enterprice_State"].ToString(); } return enterprice; }
public int UpdateEnterpriceInfo0(Enterprice enterprice) { StringBuilder sql = new StringBuilder(); sql.Append("update Enterprice set Enterprice_FullName=@fullName,Enterprice_ShortName=@shortName,Enterprice_Url=@url,Enterprice_Introduction=@introduction,Enterprice_Location=@location,Enterprice_LocationCity=@locationCity,Enterprice_Scale=@scale where Enterprice_Email like @email"); SqlParameter[] par ={ new SqlParameter("@fullName",SqlDbType.Text), new SqlParameter("@shortName",SqlDbType.Text), new SqlParameter("@url",SqlDbType.Text), new SqlParameter("@introduction",SqlDbType.Text), new SqlParameter("@location",SqlDbType.Text), new SqlParameter("@locationCity",SqlDbType.Text), new SqlParameter("@scale",SqlDbType.Text), new SqlParameter("@email",SqlDbType.Text) }; par[0].Value = enterprice.Enterprice_FullName; par[1].Value = enterprice.Enterprice_ShortName; par[2].Value = enterprice.Enterprice_Url; par[3].Value = enterprice.Enterprice_Introduction; par[4].Value = enterprice.Enterprice_Location; par[5].Value = enterprice.Enterprice_LocationCity; par[6].Value = enterprice.Enterprice_Scale; par[7].Value = enterprice.Enterprice_Email; return Common.DbHelperSQL.ExecuteSql(sql.ToString(), par); }
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; } }
public int UpdateEnterpriceInfo0(Enterprice enterprice) { OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory(); OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance(); return dalad.UpdateEnterpriceInfo0(enterprice); }