/*__________________________________________________________________________________________*/ private void MapFormDataFromGlobalRecord() { SupportCommentsVO Record = CustToEdit.SupportCommentRecord; TxbComment.Text = Record.CommentNote; CmbBoxCategory.Text = Record.Category; TxbEmployeeNumber.Text = Record.EmployeeNumber; this.Category = Record.Category; this.EmployeeNumber = Record.EmployeeNumber; }
/*__________________________________________________________________________________________*/ private void BtnAppend_Click(object sender, EventArgs e) { string commentText = checkNull(this.TxbComment.Text); string empNumber = checkNull(this.TxbEmployeeNumber.Text); Category selectedCategory = (Category)this.CmbBoxCategory.SelectedItem; string categoryId = selectedCategory.CategoryId.ToString(); if (commentText.Equals(string.Empty) || categoryId.Equals("0")) { MessageBox.Show("Please enter Comments and category and submit again.", "Error", MessageBoxButtons.OK); if (commentText.Equals(string.Empty)) { this.TxbComment.Focus(); } if (categoryId.Equals(string.Empty)) { this.LblCategory.ForeColor = Color.Red; this.LblCategory.Focus(); } return; } bool retValue = false; DialogResult dgr; string errorCode = string.Empty; string errorMessage = string.Empty; try { do { string userId = Support.Logic.CashlinxPawnSupportSession.Instance.LoggedInUserSecurityProfile.UserID; retValue = new Support.Controllers.Database.Procedures.CustomerDBProcedures(GlobalDataAccessor.Instance.DesktopSession). WriteSupportCustomerCommentToDBData( CustToEdit.CustomerNumber, commentText, userId, categoryId, empNumber, out errorCode, out errorMessage); if (retValue) { var commentRecord = new SupportCommentsVO(); commentRecord.CommentNote = commentText; commentRecord.LastUpDateDATE = DateTime.Now; commentRecord.UpDatedBy = Support.Logic.CashlinxPawnSupportSession.Instance.LoggedInUserSecurityProfile.UserID;; commentRecord.Category = selectedCategory.CategoryName;//categoryId; commentRecord.EmployeeNumber = empNumber; //CustToEdit.addSupportComment(commentRecord); CustToEdit.insertSupportComment(commentRecord, 0); break; } else { dgr = errorCode.Equals("1") ? MessageBox.Show("Inserting Customer Comments Failed. Please retry or cancel" + ": " + errorMessage, "Warning", MessageBoxButtons.OK) : MessageBox.Show("Inserting Customer Comments Failed. Please retry or cancel" + ": " + errorMessage, "Error", MessageBoxButtons.OK); } } while (dgr == DialogResult.Retry); if (errorCode.Equals("1")) // return; //this.Close(); { this.NavControlBox.IsCustom = true; this.NavControlBox.CustomDetail = "SupportCustomerComment"; this.NavControlBox.Action = NavBox.NavAction.BACK; } } catch (ApplicationException aEx) { //exception already handled at the oracledataaccessor level MessageBox.Show(aEx.Message); } //this.Close(); this.NavControlBox.IsCustom = true; this.NavControlBox.CustomDetail = "SupportCustomerComment"; this.NavControlBox.Action = NavBox.NavAction.BACK; }