예제 #1
0
 internal WorkFlowObject(string Title, Content.Folder ParentFolder, ContentStatuses ContentStatus, WorkFlowObjectTypes ObjectType, [Optional, DefaultParameterValue(0)]int CurrentWorkFlowId)
 {
     _title = Title;
     _folder = ParentFolder;
     _contentStatus = ContentStatus;
     _objectType = ObjectType;
     _workFlowInstanceId = CurrentWorkFlowId;
 }
예제 #2
0
 public static List<ObjectHistory> LoadHistory(int? ObjectId, User.User ModifiedBy, WorkFlowObjectTypes ObjectType, ContentStatuses? Status, DateTime? StartDate, DateTime? EndDate)
 {
     System.Data.Common.DbDataReader reader = SiteSettings.DataAccess.ObjectHistoryLoadHistory(ObjectId, ModifiedBy, ObjectType, Status, StartDate, EndDate);
     List<ObjectHistory> History = new List<ObjectHistory>();
     while (reader.Read()) {
         History.Add(
             new ObjectHistory(
                 reader.GetInt32(0),
                 reader.GetInt32(1),
                 reader.GetFloat(2),
                 reader.GetDateTime(3),
                 reader.GetDateTime(4),
                 reader.GetString(5)));
     }
     return History;
 }
예제 #3
0
 /// <summary>
 /// If the content is in a editable state give edit rights to the current user, at this point the content will no
 /// longer be in an editable state
 /// </summary>
 public bool CheckOut(out string ErrorMessage)
 {
     ErrorMessage = string.Empty;
     if (HasEditRights()) {
         int ResponseCode = SiteSettings.DataAccess.WorkFlowObjectHistoryAdd(GetObjectId(), ObjectType, ContentStatuses.CheckedOut);
         switch (ResponseCode) {
             case 0:
                 ErrorMessage = "Object checked out by another user.";
                 break;
             case 1:
                 _contentStatus = ContentStatuses.CheckedOut;
                 break;
         }
         return(ErrorMessage == string.Empty?true:false);
     }
     else {
         ErrorMessage = "The current user does not have rights to edit the requested object";
         return false;
     }
 }