// GET api/decisionstatus public IEnumerable<DecisionStatus> Get() { List<DecisionStatus> listDecisionStatus = new List<DecisionStatus>(); DataView dvDecisionStatus = DecisionStatusBO.GetDecisionStatusIDForSync(); foreach (DataRowView drvDecisionStatus in dvDecisionStatus) { DecisionStatus decisionStatus = new DecisionStatus(); listDecisionStatus.Add(DecisionStatusBO.GetDecisionStatus(Convert.ToInt32(drvDecisionStatus["DecisionStatusID"]))); } return listDecisionStatus; }
// POST api/decisionstatus public DecisionStatus Post(DecisionStatus decisionStatus) { if (decisionStatus.GUID > 0) { decisionStatus.DecisionStatusID = decisionStatus.GUID; int rowResult = DecisionStatusBO.UpdateDecisionStatus(decisionStatus); //Return Back to The Client return decisionStatus; } else { int rowResult = DecisionStatusBO.InsertDecisionStatus(decisionStatus); //Return Back to The Client return decisionStatus; } }
public int InsertDecisionStatus(DecisionStatus objDecisionStatus) { objDecisionStatus.DecisionStatusID = 1; BeginTransaction(); try { objDecisionStatus.DecisionStatusID = Insert(objDecisionStatus); CommitTransaction(); } catch (Exception ex) { RollBackTransaction(); objDecisionStatus.DecisionStatusID = -1; } return objDecisionStatus.DecisionStatusID; }
public int DeleteDecisionStatus(DecisionStatus objDecisionStatus) { int rowsaffected = -1; BeginTransaction(); try { String[] UpdateProperties = new String[] { "Status" }; rowsaffected = Update(objDecisionStatus, UpdateProperties); CommitTransaction(); } catch (Exception e) { RollBackTransaction(); rowsaffected = -1; } return rowsaffected; }
public static int DeleteDecisionStatus(DecisionStatus objDecisionStatus) { return new DecisionStatusDAO().DeleteDecisionStatus(objDecisionStatus); }
public static int UpdateDecisionStatus(DecisionStatus objDecisionStatus) { return new DecisionStatusDAO().UpdateDecisionStatus(objDecisionStatus); }
public static DecisionStatus GetDecisionStatus(int DecisionStatusID) { DecisionStatus objDecisionStatus = new DecisionStatus(); return (DecisionStatus)(new DecisionStatusDAO().FillDTO(objDecisionStatus, "DecisionStatusID=" + DecisionStatusID)); }
public static int InsertDecisionStatus(DecisionStatus objDecisionStatus) { return new DecisionStatusDAO().InsertDecisionStatus(objDecisionStatus); }