예제 #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 void Delete(int Original_ApprovalFlowID)
 {
     ApprovalFlowDAC approvalflowComponent = new ApprovalFlowDAC();
     approvalflowComponent.DeleteApprovalFlow(Original_ApprovalFlowID);
 }
예제 #5
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     ApprovalFlowDAC approvalflowcomponent = new ApprovalFlowDAC();
     return approvalflowcomponent.UpdateDataset(dataset);
 }
예제 #6
0
 public bool Update( int SectionID,  string Title,  DateTime DateStart,  DateTime DateEnd,  int ApprovedBy,  int Original_ApprovalFlowID)
 {
     ApprovalFlowDAC approvalflowComponent = new ApprovalFlowDAC();
     return approvalflowComponent.UpdateApprovalFlow( SectionID,  Title,  DateStart,  DateEnd,  ApprovedBy,  Original_ApprovalFlowID);
 }
예제 #7
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);
 }
예제 #8
0
        public bool Insert( int SectionID,  string Title,  DateTime DateStart,  DateTime DateEnd,  int ApprovedBy)
        {
            ApprovalFlowDAC approvalflowComponent = new ApprovalFlowDAC();
            int ApprovalFlowID = 0;

            return approvalflowComponent.InsertNewApprovalFlow( ref ApprovalFlowID,  SectionID,  Title,  DateStart,  DateEnd,  ApprovedBy);
        }