public bool Reprint(string strMembershipID, User aUser, CardStatusType myType, string strCardBranchCode) { ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider(); TblMember sqlMember = new TblMember(); TblCardRequest sqlCardRequest = new TblCardRequest(); TblAudit sqlAudit = new TblAudit(); bool isSuccess = false; try { sqlMember.MainConnectionProvider = connProvider; sqlCardRequest.MainConnectionProvider = connProvider; sqlAudit.MainConnectionProvider = connProvider; connProvider.OpenConnection(); connProvider.BeginTransaction("ReprintCard"); sqlMember.UpdateCardStatus(strMembershipID, (int)myType, strCardBranchCode); sqlCardRequest.NEmployeeID = aUser.NEmployeeID(); sqlCardRequest.NStatusID = (int)myType; sqlCardRequest.StrBranchCode = aUser.StrBranchCode(); sqlCardRequest.StrMembershipID = strMembershipID; sqlCardRequest.DtLastEditDate = DateTime.Now; sqlCardRequest.Insert(); sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberCard; sqlAudit.NEmployeeID = aUser.NEmployeeID(); sqlAudit.StrAuditEntry = "Reprint member card."; sqlAudit.StrReference = strMembershipID; sqlAudit.DtDate = DateTime.Now; sqlAudit.Insert(); connProvider.CommitTransaction(); isSuccess = true; } catch (Exception) { connProvider.RollbackTransaction("ReprintCard"); throw; } finally { if (connProvider.CurrentTransaction != null) { connProvider.CurrentTransaction.Dispose(); } if (connProvider.DBConnection != null) { if (connProvider.DBConnection.State == ConnectionState.Open) { connProvider.DBConnection.Close(); } connProvider.DBConnection.Dispose(); } sqlMember.Dispose(); sqlCardRequest.Dispose(); sqlAudit.Dispose(); } return(isSuccess); }
public bool Delete(string strMembershipID, User aUser, string strRemark) { ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider(); TblMember sqlMember = new TblMember(); TblAudit sqlAudit = new TblAudit(); bool isSuccess = false; try { sqlMember.MainConnectionProvider = connProvider; sqlAudit.MainConnectionProvider = connProvider; connProvider.OpenConnection(); connProvider.BeginTransaction("DeleteMember"); sqlMember.DeleteMember(strMembershipID, strRemark); sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberRecord; sqlAudit.NEmployeeID = aUser.NEmployeeID(); sqlAudit.StrAuditEntry = "Delete member " + strMembershipID; sqlAudit.StrReference = strMembershipID; sqlAudit.DtDate = DateTime.Now; sqlAudit.Insert(); connProvider.CommitTransaction(); isSuccess = true; } catch (Exception) { connProvider.RollbackTransaction("DeleteMember"); throw; } finally { if (connProvider.CurrentTransaction != null) { connProvider.CurrentTransaction.Dispose(); } if (connProvider.DBConnection != null) { if (connProvider.DBConnection.State == ConnectionState.Open) { connProvider.DBConnection.Close(); } connProvider.DBConnection.Dispose(); } sqlMember.Dispose(); sqlAudit.Dispose(); } return(isSuccess); }
private void LoadLeaveDetail() { User oUser = new User(); //Up_get_LeaveDetailList DataTable dt; string strSQL; strSQL = "Up_get_LeaveDetails'" + oUser.NEmployeeID() + "','" + cmbBranch.EditValue.ToString()+ "'"; DataSet _ds = new DataSet(); SqlHelper.FillDataset(connection,CommandType.StoredProcedure,"UP_GETDATA",_ds,new string[] {"table"}, new SqlParameter("@strSQL", strSQL) ); dt = _ds.Tables["table"]; DataView dv = new DataView(dt); string sql = ""; //string sql = " (MM >= " + this.prevFromMonth.EditValue + " And YY >=" + this.prevFromYear.EditValue + ") And (MM <= " + this.prevToMonth.EditValue + " And YY <=" + this.prevToYear.EditValue + ")"; DateTime thisMonth,NextMonth; thisMonth=new DateTime(ACMS.Convert.ToDBInt32(prevFromYear.EditValue),ACMS.Convert.ToDBInt32(prevFromMonth.EditValue),1,0,0,0,1); NextMonth=new DateTime(ACMS.Convert.ToDBInt32(prevToYear.EditValue),ACMS.Convert.ToDBInt32(prevToMonth.EditValue),1,0,0,0,1); NextMonth=NextMonth.AddMonths(1); sql = "dtStartTime >= '" + thisMonth.ToLongDateString() + "' And dtStartTime < '"+ NextMonth.ToShortDateString() +"'"; sql += "And nStatusID = " + ddlStatus.EditValue; if (status != "ViewAll") { // sql = string.Format("dtStartTime >= #{1}-{0}-01# And dtStartTime < #{3}-{2}-01#", Convert.ToInt32(prevFromMonth.EditValue).ToString("0#"), prevFromYear.Text, (Convert.ToInt32(prevToMonth.EditValue)+1).ToString("0#"), prevToYear.Text); if (cmbBranch.EditValue != null && cmbBranch.EditValue.ToString() != "") sql += " And strBranchCode = '" + cmbBranch.EditValue + "'"; } dv.RowFilter = sql; this.gridLeaveDetails.DataSource = dv; status = ""; }
private void BindBranch() { ACMSLogic.User oUser = new User(); string strSQL = "Select strBranchCode,strBranchName from TblBranch Where strBranchCode In (Select strBranchCode from tblemployeebranchrights Where nEmployeeId = " + oUser.NEmployeeID() + ")"; comboBind(cmbBranch, strSQL, "strBranchName", "strBranchCode", true); cmbBranch.Properties.Items.Insert(0,new DevExpress.XtraEditors.Controls.ImageComboBoxItem("- Please Select -","")); cmbBranch.SelectedIndex = 0; }
private void sbtnSave_Click(object sender, System.EventArgs e) { if (txtMemberName.Text.Length == 0) { UI.ShowErrorMessage(this, "Please fill in Member Name."); txtMemberName.Focus(); DialogResult = DialogResult.None; return; } if (txtNRICFIN.Text.Length == 0) { UI.ShowErrorMessage(this, "Please fill in NIRC/FIN."); txtNRICFIN.Focus(); DialogResult = DialogResult.None; return; } if (chkedtIsSg.Checked && !MemberRecord.ValidateNRICFormat(txtNRICFIN.Text)) { if (UI.ShowYesNoMessage(this, "NIRC is not in valid format. Do you want enter again?", "Reminder")) { txtNRICFIN.Focus(); DialogResult = DialogResult.None; return; } } if (chkedtIsSg.Checked) { if (myMemberRecord.CheckDuplicateNRIC(txtNRICFIN.Text, "") > 0) { ACMS.Utils.UI.ShowErrorMessage(this, "This NRIC already registed by other person.", "Duplicate NRIC"); txtNRICFIN.Focus(); DialogResult = DialogResult.None; return; } } if (dateedtDOB.EditValue == null || dateedtDOB.EditValue.ToString().Length == 0) { ACMS.Utils.UI.ShowErrorMessage(this, "Please enter Date of Birth."); dateedtDOB.Focus(); DialogResult = DialogResult.None; return; } try { if (chkedtMember.Checked) { strMembershipID = myMemberRecord.AddNewMember(chkedtMember.Checked, strTerminalBranchCode, txtMemberName.Text, chkedtIsSg.Checked, txtNRICFIN.Text, myUser.NEmployeeID(), dateedtDOB.DateTime, myUser); } else { strMembershipID = myMemberRecord.AddNewMember(chkedtMember.Checked, myUser.StrBranchCode(), txtMemberName.Text, chkedtIsSg.Checked, txtNRICFIN.Text, myUser.NEmployeeID(), dateedtDOB.DateTime, myUser); } } catch (Exception ex) { if (ex.InnerException.Message.IndexOf( "Violation of PRIMARY KEY constraint 'PK_tblMember'. Cannot insert duplicate key in object 'tblMember") != -1) { UI.ShowErrorMessage("Duplicate ID found. Please reset membership ID."); DialogResult = DialogResult.Cancel; } else { throw; } } DialogResult = DialogResult.OK; }
public bool UpdateMember(string strMembershipID, object dateDob, bool fAirCrew, bool fBoundCheck, bool fEmail, bool fGiroFailed, bool fPostalMail, bool fSingaporean, bool fSMS, int nLoyaltyStatusID, string strAdd1, string strAdd2, string strAltEmail, string strCardName, string strCompany, string strCreditCardNo, string strEmail, string strEmergencyContactNo, string strEmergencyContactPerson, string strHomeNo, string strMemberName, string strMobileNo, string strNIRCFIN, string strOccupation, string strOfficeNo, string strPagerNo, string strPostalCode, string strRemark, int nMediaSourceID, string strMediaSource, string strBeforePhoto, string strAfterPhoto, byte[] imgPhoto, User aUser, bool fFemale, bool fPhoneCall, string strSecurityQuestion, string strSecurityAnswer, string strMobileAppPwd) { ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider(); TblMember sqlMember = new TblMember(); TblAudit sqlAudit = new TblAudit(); bool isSuccess = false; try { sqlMember.MainConnectionProvider = connProvider; sqlAudit.MainConnectionProvider = connProvider; connProvider.OpenConnection(); connProvider.BeginTransaction("UpdateMemberRecord"); sqlMember.StrMembershipID = strMembershipID; sqlMember.FFemale = fFemale; sqlMember.FAirCrew = fAirCrew; sqlMember.FBounceCheck = fBoundCheck; sqlMember.FEmail = fEmail; sqlMember.FGIROFailed = fGiroFailed; sqlMember.FPostalMail = fPostalMail; sqlMember.FSingaporean = fSingaporean; sqlMember.FSMS = fSMS; sqlMember.FPhoneCall = fPhoneCall; if (nLoyaltyStatusID != 0) { sqlMember.NLoyaltyStatusID = nLoyaltyStatusID; } sqlMember.StrAddress1 = strAdd1; sqlMember.StrAddress2 = strAdd2; sqlMember.StrAltEmail = strAltEmail; sqlMember.StrCardName = strCardName; sqlMember.StrCompany = strCompany; sqlMember.StrCreditCardNo = strCreditCardNo; sqlMember.StrEmail = strEmail; sqlMember.StrEmergencyContactNumber = strEmergencyContactNo; sqlMember.StrEmergencyContactPerson = strEmergencyContactPerson; sqlMember.StrHomeNo = strHomeNo; sqlMember.StrMemberName = strMemberName; sqlMember.StrMobileNo = strMobileNo; sqlMember.StrNRICFIN = strNIRCFIN; sqlMember.StrOccupation = strOccupation; sqlMember.StrOfficeNo = strOfficeNo; sqlMember.StrPagerNo = strPagerNo; sqlMember.StrPostalCode = strPostalCode; sqlMember.StrRemarks = strRemark; sqlMember.NMediaSourceID = nMediaSourceID; sqlMember.StrMediaSource = strMediaSource; sqlMember.NEmployeeID = aUser.NEmployeeID(); sqlMember.StrSecurityQuestion = strSecurityQuestion; sqlMember.StrSecurityAnswer = strSecurityAnswer; sqlMember.StrPassword = strMobileAppPwd; sqlMember.Update2(dateDob, strBeforePhoto, strAfterPhoto, imgPhoto); sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberRecord; sqlAudit.NEmployeeID = aUser.NEmployeeID(); sqlAudit.StrAuditEntry = "Update member " + strMembershipID; sqlAudit.StrReference = strMembershipID; sqlAudit.DtDate = DateTime.Now; sqlAudit.Insert(); connProvider.CommitTransaction(); isSuccess = true; } catch (Exception) { connProvider.RollbackTransaction("UpdateMemberRecord"); throw; } finally { if (connProvider.CurrentTransaction != null) { connProvider.CurrentTransaction.Dispose(); } if (connProvider.DBConnection != null) { if (connProvider.DBConnection.State == ConnectionState.Open) { connProvider.DBConnection.Close(); } connProvider.DBConnection.Dispose(); } sqlMember.Dispose(); sqlAudit.Dispose(); } return(isSuccess); }
public string ConvertMember(DataRow rowMember, User aUser) { ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider(); TblMember sqlMember = new TblMember(); TblBranch sqlBranch = new TblBranch(); TblAudit sqlAudit = new TblAudit(); TblCardRequest sqlCardRequest = new TblCardRequest(); try { sqlBranch.MainConnectionProvider = connProvider; sqlMember.MainConnectionProvider = connProvider; sqlAudit.MainConnectionProvider = connProvider; sqlCardRequest.MainConnectionProvider = connProvider; connProvider.OpenConnection(); connProvider.BeginTransaction("ConvertMember"); sqlBranch.StrBranchCode = aUser.StrBranchCode(); sqlBranch.IncOne(); string newMembershipID = aUser.StrBranchCode().TrimEnd() + sqlBranch.NMembershipNo; sqlMember.StrBranchCode = aUser.StrBranchCode(); sqlMember.ConvertMember(rowMember["strMembershipID"].ToString(), newMembershipID); sqlMember.ConvertMemberPurchase(rowMember["strMembershipID"].ToString(), newMembershipID); sqlAudit.UpdateAllWstrReferenceLogic(newMembershipID, rowMember["strMembershipID"].ToString()); sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberRecord; sqlAudit.NEmployeeID = aUser.NEmployeeID(); sqlAudit.StrAuditEntry = "Convert member from " + rowMember["strMembershipID"].ToString() + " to " + newMembershipID; sqlAudit.StrReference = newMembershipID; sqlAudit.DtDate = DateTime.Now; sqlAudit.Insert(); //Request print for convert non member to member //sqlCardRequest.NEmployeeID = aUser.NEmployeeID(); //sqlCardRequest.NStatusID = (int)CardStatusType.RequestPrint; //sqlCardRequest.StrBranchCode = aUser.StrBranchCode(); //sqlCardRequest.StrMembershipID = newMembershipID; //sqlCardRequest.DtLastEditDate = DateTime.Now; //sqlCardRequest.Insert(); ////Audit trail for request print //sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberCard; //sqlAudit.NEmployeeID = aUser.NEmployeeID(); //sqlAudit.StrAuditEntry = "New member card request when create convert member."; //sqlAudit.StrReference = newMembershipID; //sqlAudit.DtDate = DateTime.Now; //sqlAudit.Insert(); connProvider.CommitTransaction(); return(newMembershipID); } catch (Exception) { connProvider.RollbackTransaction("ConvertMember"); throw; } finally { if (connProvider.CurrentTransaction != null) { connProvider.CurrentTransaction.Dispose(); } if (connProvider.DBConnection != null) { if (connProvider.DBConnection.State == ConnectionState.Open) { connProvider.DBConnection.Close(); } connProvider.DBConnection.Dispose(); } sqlBranch.Dispose(); sqlMember.Dispose(); sqlAudit.Dispose(); sqlCardRequest.Dispose(); } }
public bool UpdateMember(string strMembershipID, object dateDob, bool fAirCrew, bool fBoundCheck, bool fEmail, bool fGiroFailed, bool fPostalMail, bool fSingaporean, bool fSMS, int nLoyaltyStatusID, string strAdd1, string strAdd2, string strAltEmail, string strCardName, string strCompany, string strCreditCardNo, string strEmail, string strEmergencyContactNo, string strEmergencyContactPerson, string strHomeNo, string strMemberName, string strMobileNo, string strNIRCFIN, string strOccupation, string strOfficeNo, string strPagerNo, string strPostalCode, string strRemark, int nMediaSourceID, string strMediaSource, string strBeforePhoto, string strAfterPhoto, byte[] imgPhoto, User aUser, bool fFemale, bool fPhoneCall, string strSecurityQuestion, string strSecurityAnswer, string strMobileAppPwd) { ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider(); TblMember sqlMember = new TblMember(); TblAudit sqlAudit = new TblAudit(); bool isSuccess = false; try { sqlMember.MainConnectionProvider = connProvider; sqlAudit.MainConnectionProvider = connProvider; connProvider.OpenConnection(); connProvider.BeginTransaction("UpdateMemberRecord"); sqlMember.StrMembershipID = strMembershipID; sqlMember.FFemale = fFemale; sqlMember.FAirCrew = fAirCrew; sqlMember.FBounceCheck = fBoundCheck; sqlMember.FEmail = fEmail; sqlMember.FGIROFailed = fGiroFailed; sqlMember.FPostalMail = fPostalMail; sqlMember.FSingaporean = fSingaporean; sqlMember.FSMS = fSMS; sqlMember.FPhoneCall = fPhoneCall; if (nLoyaltyStatusID != 0) { sqlMember.NLoyaltyStatusID = nLoyaltyStatusID; } sqlMember.StrAddress1 = strAdd1; sqlMember.StrAddress2 = strAdd2; sqlMember.StrAltEmail = strAltEmail; sqlMember.StrCardName = strCardName; sqlMember.StrCompany = strCompany; sqlMember.StrCreditCardNo = strCreditCardNo; sqlMember.StrEmail = strEmail; sqlMember.StrEmergencyContactNumber = strEmergencyContactNo; sqlMember.StrEmergencyContactPerson = strEmergencyContactPerson; sqlMember.StrHomeNo = strHomeNo; sqlMember.StrMemberName = strMemberName; sqlMember.StrMobileNo = strMobileNo; sqlMember.StrNRICFIN = strNIRCFIN; sqlMember.StrOccupation = strOccupation; sqlMember.StrOfficeNo = strOfficeNo; sqlMember.StrPagerNo = strPagerNo; sqlMember.StrPostalCode = strPostalCode; sqlMember.StrRemarks = strRemark; sqlMember.NMediaSourceID = nMediaSourceID; sqlMember.StrMediaSource = strMediaSource; sqlMember.NEmployeeID = aUser.NEmployeeID(); sqlMember.StrSecurityQuestion = strSecurityQuestion; sqlMember.StrSecurityAnswer = strSecurityAnswer; sqlMember.StrPassword = strMobileAppPwd; sqlMember.Update2(dateDob, strBeforePhoto, strAfterPhoto, imgPhoto); sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberRecord; sqlAudit.NEmployeeID = aUser.NEmployeeID(); sqlAudit.StrAuditEntry = "Update member " +strMembershipID; sqlAudit.StrReference = strMembershipID; sqlAudit.DtDate = DateTime.Now; sqlAudit.Insert(); connProvider.CommitTransaction(); isSuccess = true; } catch (Exception) { connProvider.RollbackTransaction("UpdateMemberRecord"); throw; } finally { if (connProvider.CurrentTransaction != null) connProvider.CurrentTransaction.Dispose(); if (connProvider.DBConnection != null) { if (connProvider.DBConnection.State == ConnectionState.Open) connProvider.DBConnection.Close(); connProvider.DBConnection.Dispose(); } sqlMember.Dispose(); sqlAudit.Dispose(); } return isSuccess; }
public bool UpdateCardStatus(string strMembershipID, User aUser, CardStatusType myType, int nRequestID, string strBranchCode) { ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider(); TblMember sqlMember = new TblMember(); TblCardRequest sqlCardRequest = new TblCardRequest(); TblAudit sqlAudit = new TblAudit(); bool isSuccess = false; try { sqlMember.MainConnectionProvider = connProvider; sqlCardRequest.MainConnectionProvider = connProvider; sqlAudit.MainConnectionProvider = connProvider; connProvider.OpenConnection(); connProvider.BeginTransaction("ChangeCardStatus"); if (CardStatusType.RequestPrint == myType) sqlMember.UpdateCardStatus(strMembershipID, (int)myType, "HQ"); else sqlMember.UpdateCardStatus(strMembershipID, (int)myType, strBranchCode); sqlCardRequest.NEmployeeID = aUser.NEmployeeID(); sqlCardRequest.NRequestID = nRequestID; sqlCardRequest.NStatusID = (int)myType; sqlCardRequest.StrBranchCode = strBranchCode; sqlCardRequest.StrMembershipID = strMembershipID; sqlCardRequest.DtLastEditDate = DateTime.Now; sqlCardRequest.Update(); sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberCard; sqlAudit.NEmployeeID = aUser.NEmployeeID(); sqlAudit.StrAuditEntry = "Update member card to " +myType.ToString() +"."; sqlAudit.StrReference = strMembershipID; sqlAudit.DtDate = DateTime.Now; sqlAudit.Insert(); connProvider.CommitTransaction(); isSuccess = true; } catch (Exception) { connProvider.RollbackTransaction("ChangeCardStatus"); throw; } finally { if (connProvider.CurrentTransaction != null) connProvider.CurrentTransaction.Dispose(); if (connProvider.DBConnection != null) { if (connProvider.DBConnection.State == ConnectionState.Open) connProvider.DBConnection.Close(); connProvider.DBConnection.Dispose(); } sqlMember.Dispose(); sqlCardRequest.Dispose(); sqlAudit.Dispose(); } return isSuccess; }
public bool Delete(string strMembershipID, User aUser, string strRemark) { ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider(); TblMember sqlMember = new TblMember(); TblAudit sqlAudit = new TblAudit(); bool isSuccess = false; try { sqlMember.MainConnectionProvider = connProvider; sqlAudit.MainConnectionProvider = connProvider; connProvider.OpenConnection(); connProvider.BeginTransaction("DeleteMember"); sqlMember.DeleteMember(strMembershipID, strRemark); sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberRecord; sqlAudit.NEmployeeID = aUser.NEmployeeID(); sqlAudit.StrAuditEntry = "Delete member " +strMembershipID; sqlAudit.StrReference = strMembershipID; sqlAudit.DtDate = DateTime.Now; sqlAudit.Insert(); connProvider.CommitTransaction(); isSuccess = true; } catch (Exception) { connProvider.RollbackTransaction("DeleteMember"); throw; } finally { if (connProvider.CurrentTransaction != null) connProvider.CurrentTransaction.Dispose(); if (connProvider.DBConnection != null) { if (connProvider.DBConnection.State == ConnectionState.Open) connProvider.DBConnection.Close(); connProvider.DBConnection.Dispose(); } sqlMember.Dispose(); sqlAudit.Dispose(); } return isSuccess; }
public string ConvertMember(DataRow rowMember, User aUser) { ACMSDAL.ConnectionProvider connProvider = new ConnectionProvider(); TblMember sqlMember = new TblMember(); TblBranch sqlBranch = new TblBranch(); TblAudit sqlAudit = new TblAudit(); TblCardRequest sqlCardRequest = new TblCardRequest(); try { sqlBranch.MainConnectionProvider = connProvider; sqlMember.MainConnectionProvider = connProvider; sqlAudit.MainConnectionProvider = connProvider; sqlCardRequest.MainConnectionProvider = connProvider; connProvider.OpenConnection(); connProvider.BeginTransaction("ConvertMember"); sqlBranch.StrBranchCode = aUser.StrBranchCode(); sqlBranch.IncOne(); string newMembershipID = aUser.StrBranchCode().TrimEnd() +sqlBranch.NMembershipNo; sqlMember.StrBranchCode = aUser.StrBranchCode(); sqlMember.ConvertMember(rowMember["strMembershipID"].ToString(), newMembershipID); sqlMember.ConvertMemberPurchase(rowMember["strMembershipID"].ToString(), newMembershipID); sqlAudit.UpdateAllWstrReferenceLogic(newMembershipID, rowMember["strMembershipID"].ToString()); sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberRecord; sqlAudit.NEmployeeID = aUser.NEmployeeID(); sqlAudit.StrAuditEntry = "Convert member from " +rowMember["strMembershipID"].ToString() +" to " +newMembershipID; sqlAudit.StrReference = newMembershipID; sqlAudit.DtDate = DateTime.Now; sqlAudit.Insert(); //Request print for convert non member to member //sqlCardRequest.NEmployeeID = aUser.NEmployeeID(); //sqlCardRequest.NStatusID = (int)CardStatusType.RequestPrint; //sqlCardRequest.StrBranchCode = aUser.StrBranchCode(); //sqlCardRequest.StrMembershipID = newMembershipID; //sqlCardRequest.DtLastEditDate = DateTime.Now; //sqlCardRequest.Insert(); ////Audit trail for request print //sqlAudit.NAuditTypeID = ACMSLogic.AuditTypeID.MemberCard; //sqlAudit.NEmployeeID = aUser.NEmployeeID(); //sqlAudit.StrAuditEntry = "New member card request when create convert member."; //sqlAudit.StrReference = newMembershipID; //sqlAudit.DtDate = DateTime.Now; //sqlAudit.Insert(); connProvider.CommitTransaction(); return newMembershipID; } catch (Exception) { connProvider.RollbackTransaction("ConvertMember"); throw; } finally { if (connProvider.CurrentTransaction != null) connProvider.CurrentTransaction.Dispose(); if (connProvider.DBConnection != null) { if (connProvider.DBConnection.State == ConnectionState.Open) connProvider.DBConnection.Close(); connProvider.DBConnection.Dispose(); } sqlBranch.Dispose(); sqlMember.Dispose(); sqlAudit.Dispose(); sqlCardRequest.Dispose(); } }