Пример #1
0
 public List<ApprovalFlow> GetAll()
 {
     ApprovalFlowDAC _approvalFlowComponent = new ApprovalFlowDAC();
      IDataReader reader =  _approvalFlowComponent.GetAllApprovalFlow().CreateDataReader();
      List<ApprovalFlow> _approvalFlowList = new List<ApprovalFlow>();
      while(reader.Read())
      {
      if(_approvalFlowList == null)
          _approvalFlowList = new List<ApprovalFlow>();
          ApprovalFlow _approvalFlow = new ApprovalFlow();
          if(reader["ApprovalFlowID"] != DBNull.Value)
              _approvalFlow.ApprovalFlowID = Convert.ToInt32(reader["ApprovalFlowID"]);
          if(reader["SectionID"] != DBNull.Value)
              _approvalFlow.SectionID = Convert.ToInt32(reader["SectionID"]);
          if(reader["Title"] != DBNull.Value)
              _approvalFlow.Title = Convert.ToString(reader["Title"]);
          if(reader["DateStart"] != DBNull.Value)
              _approvalFlow.DateStart = Convert.ToDateTime(reader["DateStart"]);
          if(reader["DateEnd"] != DBNull.Value)
              _approvalFlow.DateEnd = Convert.ToDateTime(reader["DateEnd"]);
          if(reader["ApprovedBy"] != DBNull.Value)
              _approvalFlow.ApprovedBy = Convert.ToInt32(reader["ApprovedBy"]);
      _approvalFlow.NewRecord = false;
      _approvalFlowList.Add(_approvalFlow);
      }             reader.Close();
      return _approvalFlowList;
 }
Пример #2
0
 public ApprovalFlow GetByID(int _approvalFlowID)
 {
     ApprovalFlowDAC _approvalFlowComponent = new ApprovalFlowDAC();
      IDataReader reader = _approvalFlowComponent.GetByIDApprovalFlow(_approvalFlowID);
      ApprovalFlow _approvalFlow = null;
      while(reader.Read())
      {
          _approvalFlow = new ApprovalFlow();
          if(reader["ApprovalFlowID"] != DBNull.Value)
              _approvalFlow.ApprovalFlowID = Convert.ToInt32(reader["ApprovalFlowID"]);
          if(reader["SectionID"] != DBNull.Value)
              _approvalFlow.SectionID = Convert.ToInt32(reader["SectionID"]);
          if(reader["Title"] != DBNull.Value)
              _approvalFlow.Title = Convert.ToString(reader["Title"]);
          if(reader["DateStart"] != DBNull.Value)
              _approvalFlow.DateStart = Convert.ToDateTime(reader["DateStart"]);
          if(reader["DateEnd"] != DBNull.Value)
              _approvalFlow.DateEnd = Convert.ToDateTime(reader["DateEnd"]);
          if(reader["ApprovedBy"] != DBNull.Value)
              _approvalFlow.ApprovedBy = Convert.ToInt32(reader["ApprovedBy"]);
      _approvalFlow.NewRecord = false;             }             reader.Close();
      return _approvalFlow;
 }
Пример #3
0
 public bool Insert(ApprovalFlow approvalflow)
 {
     int autonumber = 0;
     ApprovalFlowDAC approvalflowComponent = new ApprovalFlowDAC();
     bool endedSuccessfuly = approvalflowComponent.InsertNewApprovalFlow( ref autonumber,  approvalflow.SectionID,  approvalflow.Title,  approvalflow.DateStart,  approvalflow.DateEnd,  approvalflow.ApprovedBy);
     if(endedSuccessfuly)
     {
         approvalflow.ApprovalFlowID = autonumber;
     }
     return endedSuccessfuly;
 }
Пример #4
0
 public bool Update(ApprovalFlow approvalflow ,int old_approvalFlowID)
 {
     ApprovalFlowDAC approvalflowComponent = new ApprovalFlowDAC();
     return approvalflowComponent.UpdateApprovalFlow( approvalflow.SectionID,  approvalflow.Title,  approvalflow.DateStart,  approvalflow.DateEnd,  approvalflow.ApprovedBy,  old_approvalFlowID);
 }