public User(string id, string email, string firstName,DateTime birthDay, Sex sex, Address address) { UserId = id; Email = email; DateBirthDay = birthDay; Sex = sex; PhoneNumber = String.Empty; Address = address; FirstName = firstName; }
protected void btnSubmit_OnClick(object sender, EventArgs e) { var login = new Login(txtUserId.Text, txtPassWord.Text); if (login.CheckLogin() == 1) { DataTable dataTable = login.GetUserInfo(1); string userId = dataTable.Rows[0]["UserID"].ToString(); string emailLogin = dataTable.Rows[0]["Email"].ToString(); string firstName = dataTable.Rows[0]["FirstName"].ToString(); JavaScriptAleart(login.CheckAdmin(Convert.ToInt32(userId)).ToString()); if (login.CheckAdmin(Convert.ToInt32(userId))) { Session["Login"] = login; DateTime dateOfBirth = Convert.ToDateTime(dataTable.Rows[0]["DateOfBirth"].ToString()); var address = new Address(); var sex = new Sex(); var user = new User(userId, emailLogin, firstName, dateOfBirth, sex, address); Session["Admin"] = user; Response.Redirect("Index.aspx"); } else { ltrMessage.Visible = true; ltrMessage.Text = "Tài khoản của bạn không có quyền truy cập vào admin hệ thống \n"; ltrMessage.Text += "Vui lòng liên hệ để biết thêm chị tiết"; } } else { ltrMessage.Visible = true; ltrMessage.Text = "Tài Khoản không tồn tại hoặc đã bị khóa"; } }
public bool SetFullInfo(string firtname, string lastname, DateTime birthDay, Sex sex, string phoneNumber, JobIndustries job, Address address, Races races, string maxim,string thumImg) { FirstName=firtname; LastName = lastname; DateBirthDay = birthDay; Sex = sex; PhoneNumber = phoneNumber; JobIndustries = job; Address = address; Races = races; MaximOfLife = maxim; ThumImg = thumImg; return SaveInfo(); }
public void SetFullInfo() { var dao = new DaoUser(); DataTable infoTable = dao.GetFullUserInforById(Convert.ToInt32(UserId)); FirstName = infoTable.Rows[0]["FirstName"].ToString(); LastName = infoTable.Rows[0]["LastName"].ToString(); DateBirthDay = Convert.ToDateTime(infoTable.Rows[0]["DateOfBirth"]); Sex = new Sex(infoTable.Rows[0]["SexID"].ToString(), infoTable.Rows[0]["SexName"].ToString()); PhoneNumber = infoTable.Rows[0]["PhoneNumber"].ToString(); Races = new Races(infoTable.Rows[0]["RaceID"].ToString(), infoTable.Rows[0]["RaceName"].ToString()); Province = new Province( infoTable.Rows[0]["ProvinceID"].ToString(),infoTable.Rows[0]["ProvinceName"].ToString()); District = new District(infoTable.Rows[0]["DistrictID"].ToString(), infoTable.Rows[0]["DistrictName"].ToString(), Province, Convert.ToInt32(infoTable.Rows[0]["Latitude"]), Convert.ToInt32(infoTable.Rows[0]["Longitude"])); Address = new Address(Province, District); JobIndustries = new JobIndustries(infoTable.Rows[0]["JobIndustryID"].ToString(),infoTable.Rows[0]["JobIndustryName"].ToString()); MaximOfLife = infoTable.Rows[0]["MaximOfLife"].ToString(); ThumImg = infoTable.Rows[0]["PhotoPath"].ToString(); }