public bool Update() { bool issaved = false; SqlTransaction tran = null;; SqlConnection conn = null; conn = Connection.getConnection(); UnloadingBLL objOld = new UnloadingBLL(); objOld = objOld.GetById(this.Id); if (objOld == null) { throw new Exception("Null Old Value Exception"); } try { conn = Connection.getConnection(); tran = conn.BeginTransaction(); if (UnloadingDAL.UpdateUnloading(this, tran) == true) { int at = -1; AuditTrailBLL objAt = new AuditTrailBLL(); at = objAt.saveAuditTrail(objOld, this, WFStepsName.EditUnloading.ToString(), UserBLL.GetCurrentUser(), "Edit Unloading"); if (at == 1) { tran.Commit(); issaved = true; } else { tran.Rollback(); issaved = false; } } else { tran.Rollback(); issaved = false; } } catch { tran.Rollback(); throw new Exception("Unable to Update the record."); } finally { if (tran != null) { tran.Dispose(); } if (conn.State == ConnectionState.Open) { conn.Dispose(); } } return(issaved); }
public UnloadingBLL(UnloadingBLL source) { this._id = source._id; this._gradingResultId = source._gradingResultId; this._receivigRequestId = source._receivigRequestId; this._totalNumberOfBags = source._totalNumberOfBags; this._dateDeposited = source._dateDeposited; this._remark = source._remark; this._status = source._status; this.TrackingNo = source.TrackingNo; this.CreatedBy = source.CreatedBy; this.CreatedTimestamp = source.CreatedTimestamp; this.LastModifiedBy = source.LastModifiedBy; this.LastModifiedTimestamp = source.LastModifiedTimestamp; }