public void ApproveModel(Guid modelID, Guid approverID, string note)
        {
            using (new TransactionScope(TransactionScopeOption.Suppress))
            {
                var d = new ModelsDataContext();
                var o = d.BlockModels.Where(f => f.BlockModelID == modelID).Single();
                o.ApproverContactID = approverID;
                if (o.AuthorContactID.HasValue)
                    _userService.EmailUsers(_userService.GetUserEmails(new Guid[] { o.AuthorContactID.Value }), "Model approved", note);
                var n = new BlockModelMetadata();
                n.BlockModelMetadataID = Guid.NewGuid();
                n.BlockModelID = modelID;
                n.ParameterID = _privateServices.XODB_GUID_LOG;
                var oc = new Occurrence();
                oc.ID = Guid.NewGuid();
                oc.ContactID = o.ApproverContactID.Value;
                oc.Occurred = DateTime.UtcNow;
                oc.Status = (uint)Occurrence.StatusCode.OK;
                n.BlockModelMetadataText = oc.ToJson();
                d.BlockModelMetadatas.InsertOnSubmit(n);
                d.SubmitChanges();
            }

        }
 public void DenyModel(Guid modelID, Guid denierID, string error)
 {
     using (new TransactionScope(TransactionScopeOption.Suppress))
     {
         var d = new ModelsDataContext();
         var o = d.BlockModels.Where(f => f.BlockModelID == modelID && f.AuthorContactID != null).Select(f => (Guid)f.AuthorContactID).ToArray();
         _userService.EmailUsers(_userService.GetUserEmails(o), "Model not accepted", error);
         var n = new BlockModelMetadata();
         n.BlockModelMetadataID = Guid.NewGuid();
         n.BlockModelID = modelID;
         n.ParameterID = _privateServices.XODB_GUID_LOG;
         var oc = new Occurrence();
         oc.ID = Guid.NewGuid();
         oc.ContactID = denierID;
         oc.Occurred = DateTime.UtcNow;
         oc.Status = (uint)Occurrence.StatusCode.Notified;
         n.BlockModelMetadataText = oc.ToJson();
         d.BlockModelMetadatas.InsertOnSubmit(n);
         d.SubmitChanges();
     }
 }
Beispiel #3
0
		private void detach_BlockModelMetadatas(BlockModelMetadata entity)
		{
			this.SendPropertyChanging();
			entity.BlockModel = null;
		}
Beispiel #4
0
 partial void DeleteBlockModelMetadata(BlockModelMetadata instance);
Beispiel #5
0
 partial void UpdateBlockModelMetadata(BlockModelMetadata instance);
Beispiel #6
0
 partial void InsertBlockModelMetadata(BlockModelMetadata instance);
Beispiel #7
0
		private void attach_BlockModelMetadatas(BlockModelMetadata entity)
		{
			this.SendPropertyChanging();
			entity.Parameter = this;
		}