public bool Update(SqlTransaction tran) { bool isSaved = false; try { isSaved = GradingResultDAL.UpdateGradingResult(this, tran); } catch (Exception ex) { throw ex; } return(isSaved); }
public bool UpdateGradingResult(List <GradingResultDetailBLL> list, Nullable <Guid> Id, string TrackingNo) { bool isSaved = false; SqlConnection conn = Connection.getConnection(); SqlTransaction tran = conn.BeginTransaction(); this.WarehouseId = UserBLL.GetCurrentWarehouse(); if (Id != null) { try { this.ID = (Guid)Id; if (GradingResultDAL.InactivateGradingResultDetails(this.ID, tran) == true) { int at = -1; AuditTrailBLL objAt = new AuditTrailBLL(); string strNew = "(Grading Result Id -" + this.ID.ToString() + "),(LastModifiedby-" + UserBLL.GetCurrentUser().ToString() + "),(LastModifiedTimeStamp-" + DateTime.Now.ToString() + ")"; at = objAt.saveAuditTrailStringFormat("Grading Factor Details Cancelled", strNew, WFStepsName.EditGradingResultDet.ToString(), UserBLL.GetCurrentUser(), "Cancel Grading Result Detail"); if (at == -1) { tran.Rollback(); isSaved = false; } else { GradingResultBLL objGR = new GradingResultBLL(); objGR = objGR.GetGradingResultById(this.ID); if (GradingResultDAL.UpdateGradingResult(this, tran) == true) { AuditTrailBLL objAtGR = new AuditTrailBLL(); at = objAtGR.saveAuditTrail(objGR, this, WFStepsName.EditGradingResult.ToString(), UserBLL.GetCurrentUser(), "Updating Grading Result"); if (at == -1) { tran.Rollback(); isSaved = false; return(isSaved); } GradingResultDetailBLL objDetail = new GradingResultDetailBLL(); isSaved = objDetail.Add(list, tran, Id); if (isSaved == true) { //Request ECXWF.CMessage msg = WFTransaction.Request(TrackingNo); if (msg != null) { if (msg.Name == "EditGradingResult") { WFTransaction.WorkFlowManager(TrackingNo, msg); } } } if (isSaved == false) { tran.Rollback(); isSaved = false; } else { tran.Commit(); isSaved = true; } } else { tran.Rollback(); isSaved = false; } } } else { tran.Rollback(); isSaved = false; } } catch (Exception ex) { tran.Rollback(); throw ex; } finally { tran.Dispose(); conn.Close(); } } return(isSaved); }