/// <summary> /// [삭제] 사용자 삭제. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { DialogResult answer = MessageBox.Show("사용자 정보가 완전히 삭제됩니다. 계속하시겠습니까?", "사용자 정보 삭제", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (answer != System.Windows.Forms.DialogResult.Yes) { return; } updateMode = ProfileUpdateMode.Delete; string deleteUserID = this.txtboxID.Text; int result = DBManager.GetInstance().DeleteUserAccountInfo(deleteUserID); if (result != 0) { MessageBox.Show("사용자 정보 삭제 중에 오류가 발생하였습니다. ErrorCode=[" + result + "]", "사용자 정보 삭제", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.currentAccountList = DBManager.GetInstance().QueryUserAccountInfo(); UpdateAccountList(); ResetInputText(); // 삭제가 실패한 경우, 삭제하려고 했던 아이템을 재선택 표시 }
public void SetProfileUpdateMode(ProfileUpdateMode mode) { this.currentMode = mode; if (this.currentMode == ProfileUpdateMode.Regist) { this.Text = "신규 그룹 생성"; this.lblDescription.Text = "표준경보시스템을 선택하여 그룹을 생성합니다."; this.txtboxGroupName.ResetText(); this.btnDeleteGroup.Visible = false; this.btnDeleteGroup.Enabled = false; this.btnOK.Text = "그룹 등록"; } else { this.Text = "그룹 상세 정보"; this.lblDescription.Text = "그룹 정보를 수정하거나 삭제할 수 있습니다."; this.btnDeleteGroup.Visible = true; this.btnDeleteGroup.Enabled = true; this.btnOK.Text = "변경 적용"; } }
public void ClearAll() { System.Diagnostics.Debug.Assert(this != null); this.reqEventID = uint.MinValue; this.totalCnt = uint.MinValue; this.mode = ProfileUpdateMode.Modify; this.lstSASProfile.Clear(); }
public void Update(Profile profile, ProfileUpdateMode mode = ProfileUpdateMode.None) { switch (mode) { case ProfileUpdateMode.Main: Update(profile.ProfileId, () => new Profile { ProfileId = profile.ProfileId, New = profile.New, FirstName = profile.FirstName, LastName = profile.LastName, ProfileSexId = profile.ProfileSexId, ProfileActivityId = profile.ProfileActivityId, Birfday = profile.Birfday, ContactPhone = profile.ContactPhone, CityId = profile.CityId }); break; case ProfileUpdateMode.Dop: Update(profile.ProfileId, () => new Profile { ProfileId = profile.ProfileId, New = profile.New, AboutMe = profile.AboutMe, ProfileAlcoholId = profile.ProfileAlcoholId, ProfileSmokingId = profile.ProfileSmokingId, ProfileAnimalsId = profile.ProfileAnimalsId, ProfileSexWhoId = profile.ProfileSexWhoId }); break; case ProfileUpdateMode.Avatar: Update(profile.ProfileId, () => new Profile { ProfileId = profile.ProfileId, New = profile.New, ImageType = profile.ImageType, ImageLink = profile.ImageLink, ImageAvatarType = profile.ImageAvatarType, ImageAvatarLink = profile.ImageAvatarLink, ImageAvatarBigType = profile.ImageAvatarBigType, ImageAvatarBigLink = profile.ImageAvatarBigLink }); break; } }
public void UpdateProfile(Public.Entities.Profile profile, ProfileUpdateMode mode, int[] selectedInteresesId = null) { using (var uow = _unitOfWorkFactory.Create()) { uow.Profiles.Update(profile, mode); if (mode == ProfileUpdateMode.Dop) { uow.Profiles.UpdateIntereses(profile.ProfileId, selectedInteresesId); } uow.Complete(); } }
public void DeepCopyFrom(ProfileUpdateReqData src) { System.Diagnostics.Debug.Assert(this != null); System.Diagnostics.Debug.Assert(src != null); this.reqEventID = src.reqEventID; this.totalCnt = src.totalCnt; this.mode = src.mode; this.lstSASProfile.Clear(); foreach (SASProfile profile in src.lstSASProfile) { SASProfile copyProfile = new SASProfile(); copyProfile.DeepCopyFrom(profile); this.lstSASProfile.Add(copyProfile); } }
public ProfileUpdateReqData(uint requestID, uint totalCount, ProfileUpdateMode mode) { if (totalCount <= 0) { FileLogManager.GetInstance().WriteLog("[DataSyncInfo] ProfileUpdateReqData ( Invalid Total Count. )"); throw new Exception("Invalid Total Count."); } this.reqEventID = requestID; this.totalCnt = totalCount; this.mode = mode; this.lstSASProfile = new List <SASProfile>((int)totalCount); for (int index = 0; index < totalCount; index++) { SASProfile system = new SASProfile(); this.lstSASProfile.Add(system); } }
/// <summary> /// [수정] 사용자 정보 수정. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnModify_Click(object sender, EventArgs e) { this.updateMode = ProfileUpdateMode.Modify; this.isUniqueChecked = true; // 버튼 표시 전환 this.btnRegist.Visible = false; this.btnModify.Visible = false; this.btnDelete.Visible = false; this.btnCancel.Location = this.btnModify.Location; this.btnCancel.Visible = true; this.btnSave.Location = this.btnDelete.Location; this.btnSave.Visible = true; this.pnlDetailBack.Enabled = true; this.btnCheckUnique.Visible = false; this.lvAccountList.SelectedItems.Clear(); this.txtboxID.Enabled = false; }
public UpdateGroupProfileEventArgs(GroupProfile profile, ProfileUpdateMode mode) { this.targetProfile = profile; this.updateMode = mode; }
public void UpdateProfile(Profile profile, ProfileUpdateMode mode = ProfileUpdateMode.None) { context.Profiles.Attach(profile); var entry = context.Entry(profile); entry.Property(e => e.New).IsModified = true; switch (mode) { case ProfileUpdateMode.Main: entry.Property(e => e.FirstName).IsModified = true; entry.Property(e => e.LastName).IsModified = true; entry.Property(e => e.Town).IsModified = true; entry.Property(e => e.ProfileSexId).IsModified = true; entry.Property(e => e.ProfileActivityId).IsModified = true; entry.Property(e => e.Birfday).IsModified = true; entry.Property(e => e.ContactPhone).IsModified = true; break; case ProfileUpdateMode.Dop: entry.Property(e => e.AboutMe).IsModified = true; entry.Property(e => e.ProfileAlcoholId).IsModified = true; entry.Property(e => e.ProfileSmokingId).IsModified = true; entry.Property(e => e.ProfileAnimalsId).IsModified = true; entry.Property(e => e.ProfileSexWhoId).IsModified = true; break; case ProfileUpdateMode.Avatar: entry.Property(e => e.ImageType).IsModified = true; entry.Property(e => e.ImageLink).IsModified = true; entry.Property(e => e.ImageAvatarType).IsModified = true; entry.Property(e => e.ImageAvatarLink).IsModified = true; entry.Property(e => e.ImageAvatarBigType).IsModified = true; entry.Property(e => e.ImageAvatarBigLink).IsModified = true; break; } context.SaveChanges(); //Profile updateProfile = context.Profiles.Find(profile.ProfileId); //if (updateProfile != null) //{ // updateProfile = profile; // context.Profiles.AddOrUpdate(e => e.ProfileId, profile); // context.SaveChanges(); //} }