public void LoadPaging(CommonParam param) { try { this.ListUser = new ObservableCollection <AasUserADO>(); this.CurrentUser = new AasUserADO(); this._start = param.Start ?? 0; this._limit = param.Limit ?? 0; CommonParam paramCommon = new CommonParam(this._start, this._limit); AasUserFilter filter = new AasUserFilter(); filter.KeyWord = this.KeyWord; filter.OrderDirection = "DESC"; filter.OrderField = "ModifyTime"; var rs = new BackendAdapter(paramCommon).GetRO <List <User> >(AasUser.GET, ApiConsumerStore.AasConsumer, paramCommon, filter, null); if (rs != null) { var data = (List <User>)rs.Data; Mapper.CreateMap <User, AasUserADO>(); this.ListUser = Mapper.Map <ObservableCollection <AasUserADO> >(data); if (this.ListUser != null) { this._total = (ListUser == null ? 0 : ListUser.Count); this._count = (rs.Param == null ? 0 : rs.Param.Count ?? 0); param.Count = this._count; param.Limit = this._limit; } } } catch (Exception ex) { LogSystem.Error(ex); } }
public void RestoreAnimation() { if (forceRestore || (frames == null && serializedAnimation != null && !drawingLOA && points != null && points.Count > 0)) { ClearMaps(); FillModelMap(model); frames = BackendAdapter.deserializeNodeArray(serializedAnimation); Debug.Log("Restored: " + frames.Length + " frames"); } }
public void BtnChangeLock_Click(object parameters) { try { if (parameters != null && parameters is AasUserADO) { WaitingManager.Show(); bool success = false; CommonParam commonParam = new CommonParam(); AasUserADO data = parameters as AasUserADO; if (data.IsActive == Constant.IS_TRUE) { User rs = new BackendAdapter(commonParam).Post <User>(AasUser.LOCK, ApiConsumerStore.AasConsumer, commonParam, data, null); if (rs != null) { data.IsActive = rs.IsActive; success = true; } } else { User rs = new BackendAdapter(commonParam).Post <User>(AasUser.UNLOCK, ApiConsumerStore.AasConsumer, commonParam, data, null); if (rs != null) { data.IsActive = rs.IsActive; success = true; } } WaitingManager.Close(); if (success) { MessageManager.ShowAlert(commonParam, success); CloseWindow = true; } else { MessageManager.Show(commonParam, success); } } } catch (Exception ex) { WaitingManager.Close(); LogSystem.Error(ex); } }
public void GenerateAnimation() { if (points != null && points.Count > 0) { beginPostion = model.position; beginRotation = model.rotation; currentFrame = 0; ModelData modelData = AnimationData.CreateModelData(model, points, rotationPoints, detailLoaPoints, mutatorStrength); modelData.numberOfFrames = framesOfAnimation; swellanimations.Animation animation = BackendAdapter.GenerateFromBackend(modelData); frames = animation.frames.ToArray(); serializedAnimation = BackendAdapter.serializeNodeArray(frames); //Debug.Log("Just serialized: " + serializedAnimation); ClearMaps(); FillModelMap(model); } }
public void BtnEdit_Click(object parameters) { try { if (this.CurrentUser == null || this.CurrentUser.Id <= 0) { LogSystem.Info("CurrentUser null or id > 0"); return; } WaitingManager.Show(); CommonParam commonParam = new CommonParam(); bool success = false; if (this.ValidData(this.CurrentUser, false)) { User rs = new BackendAdapter(commonParam).Post <User>(AasUser.UPDATE, ApiConsumerStore.AasConsumer, commonParam, this.CurrentUser, null); if (rs != null) { success = true; CommonParam param = new CommonParam(); param.Start = this._start; param.Limit = this._limit; this.LoadPaging(param); } } else { MessageUtil.SetMessage(commonParam, Message.Enum.Common_ThieuTruongThongTinBatBuoc); } WaitingManager.Close(); if (success) { MessageManager.ShowAlert(commonParam, success); CloseWindow = true; } else { MessageManager.Show(commonParam, success); } } catch (Exception ex) { WaitingManager.Close(); LogSystem.Error(ex); } }
public void GenerateAnimation() { if (points != null && points.Count > 0) { currentFrame = 0; List <Vector3> line = points; if (smoothCurve && points.Count >= 4) { line = GetCatmullRomCurve(line); } ModelData modelData = AnimationData.CreateModelData(model, line, rotationPoints, detailLoaPoints, framesOfAnimation, mutatorStrength); swellanimations.Animation animation = BackendAdapter.GenerateFromBackend(modelData); frames = animation.frames.ToArray(); serializedAnimation = BackendAdapter.serializeNodeArray(frames); //Debug.Log("Animation generated"); ClearMaps(); FillModelMap(model); } }