Пример #1
0
        public SaveProcessBlueprintResponse Save(SaveProcessBlueprintRequest request)
        {
            var response = new SaveProcessBlueprintResponse();
            try
            {
                var proses = new ProcessBlueprint();
                var user = DataContext.Users.Single(x => x.Id == request.UserId);
                if (request.Id > 0)
                {
                    proses = DataContext.ProcessBlueprints.Single(x => x.Id == request.Id);
                    proses.Name = request.Name;
                    proses.ParentId = request.ParentId;
                    proses.IsFolder = request.IsFolder;
                    proses.LastWriteTime = request.LastWriteTime;
                    proses.Data = request.Data;
                    proses.UpdatedBy = user;
                    DataContext.Entry(proses).State = System.Data.Entity.EntityState.Modified;
                }
                else
                {
                    proses.Name = request.Name;
                    proses.IsFolder = request.IsFolder;
                    proses.ParentId = request.ParentId;
                    proses.Data = request.Data;
                    proses.LastWriteTime = request.LastWriteTime;
                    proses.CreatedBy = user;
                    DataContext.ProcessBlueprints.Add(proses);
                }

                DataContext.SaveChanges();
                DataContext.Entry(proses).GetDatabaseValues();
                response.Id = proses.Id;
                response.IsSuccess = true;
                response.Message = "File Manager Successfully Saved";
            }
            catch (DbUpdateException ex)
            {

                response.IsSuccess = false;
                response.Message = ex.Message;
            }
            return response;
        }
Пример #2
0
 public GetProcessBlueprintResponse Save(SaveProcessBlueprintRequest request)
 {
     throw new NotImplementedException();
 }