public void CreateMember(Member member) { using (SqlConnection connection = base.GetConnection()) { SqlCommand command = new SqlCommand("_MemberUpdate", connection) { CommandType = CommandType.StoredProcedure }; command.Parameters.AddWithValue("@Type", 0); command.Parameters.AddWithValue("@MemberID", 0); command.Parameters.AddWithValue("@Username", member.UserName); command.Parameters.AddWithValue("@Password", member.Password); command.Parameters.AddWithValue("@FullName", member.FullName); command.Parameters.AddWithValue("@Email", member.Email); command.Parameters.AddWithValue("@Phone", member.Phone); command.Parameters.AddWithValue("@Address", member.Address); command.Parameters.AddWithValue("@Birth", member.Birth); command.Parameters.AddWithValue("@Actived", member.Actived); command.Parameters.AddWithValue("@Sex", member.Sex); command.Parameters.AddWithValue("@NickYahoo", member.NickYahoo); command.Parameters.AddWithValue("@NickSkype", member.NickSkype); command.Parameters.AddWithValue("@Avatar", member.Avatar); connection.Open(); if (command.ExecuteNonQuery() <= 0) { throw new DataAccessException("Lỗi kh\x00f4ng thể tao moi"); } command.Dispose(); } }
public Member ReceiveHtml() { ConfigBSO configBSO = new ConfigBSO(); Config config = configBSO.GetAllConfig(Language.language); int icon_w = Convert.ToInt32(config.New_icon_w); int icon_h = Convert.ToInt32(config.New_icon_h); SecurityBSO securityBSO = new SecurityBSO(); Member member = new Member(); string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Avatar/"; commonBSO commonBSO = new commonBSO(); string image_thumb = commonBSO.UploadImage(txtAvatar, path, icon_w, icon_h); member.MemberID = (hddMemberID.Value != "") ? Convert.ToInt32(hddMemberID.Value) : 0; member.UserName = (txtUserName.Text != "") ? txtUserName.Text.Trim() : hddUsername.Value; member.Email = (txtEmail.Text != "") ? txtEmail.Text.Trim() : ""; member.Password = (txtPassword.Text != "") ? securityBSO.EncPwd(txtPassword.Text.Trim()) : ""; member.FullName = (txtFullName.Text != "") ? txtFullName.Text.Trim() : ""; member.Address = (txtAddress.Text != "") ? txtAddress.Text.Trim() : ""; member.Phone = (txtPhone.Text != "") ? txtPhone.Text.Trim() : ""; member.NickYahoo = (txtNickYahoo.Text != "") ? txtNickYahoo.Text.Trim() : ""; member.NickSkype = (txtNickSkype.Text != "") ? txtNickSkype.Text.Trim() : ""; member.Avatar = (image_thumb != "") ? image_thumb : hddImageThumb.Value; member.Sex = Convert.ToBoolean(rdbSex.SelectedItem.Value); member.Birth = txtBirth.SelectedDate.Value; member.Actived = Convert.ToBoolean(rdbList.SelectedItem.Value); return member; }
public void UpdateMember(Member member) { new MemberDAO().UpdateMember(member); }
public void CreateMember(Member member) { new MemberDAO().CreateMember(member); }