コード例 #1
0
        public void CreateWorkOrder(string requestorEmailAddress, DateTime dateTimeReceived, string subject, string workOrderDescription)
        {
            var appUserId = GetAppUserIdByEmail(requestorEmailAddress);
            var workOrder = new WorkOrder()
            {
                CreateDateTime   = dateTimeReceived,
                ModifiedDateTime = dateTimeReceived,
                StatusDateTime   = dateTimeReceived,
                RequestorId      = appUserId,
                LocationId       = appUserId == null ? null : GetLocationIdByAppUserId(appUserId),
                UnitId           = appUserId == null ? null : GetUnitIdByAppUserId(appUserId),
                StatusId         = 1,
                Subject          = subject
            };

            _context.WorkOrders.InsertOnSubmit(workOrder);
            _context.SubmitChanges();

            var workOrderComment = new WorkOrderComment()
            {
                CommentorId    = appUserId,
                CreateDateTime = dateTimeReceived,
                WorkOrderId    = workOrder.Id,
                Comment        = dateTimeReceived + "\n\r" + requestorEmailAddress + "\n\r" + workOrderDescription
            };

            _context.WorkOrderComments.InsertOnSubmit(workOrderComment);
            _context.SubmitChanges();

            SendEmail(workOrder, requestorEmailAddress, workOrderDescription);
        }
コード例 #2
0
 private void detach_WorkOrderComments(WorkOrderComment entity)
 {
     this.SendPropertyChanging();
     entity.AppUser = null;
 }
コード例 #3
0
 private void attach_WorkOrderComments(WorkOrderComment entity)
 {
     this.SendPropertyChanging();
     entity.WorkOrder = this;
 }
コード例 #4
0
 partial void DeleteWorkOrderComment(WorkOrderComment instance);
コード例 #5
0
 partial void UpdateWorkOrderComment(WorkOrderComment instance);
コード例 #6
0
 partial void InsertWorkOrderComment(WorkOrderComment instance);