private void Save(MNorm entity) { entity.Name = Name; entity.SortId = SortId; entity.Status = Status; entity.PostDate = PostDate; entity.Content = Content; entity.MainCode = MainCode; entity.MainName = MainName; entity.AdminCode = AdminCode; entity.AdminName = AdminName; entity.ServiceCode = ServiceCode; entity.ServiceName = ServiceName; if (entity.MNormId == 0) { m_FTISService.CreateMNorm(entity); } else { m_FTISService.UpdateMNorm(entity); } LoadEntity(entity.MNormId); }
// public override void OnDropObjects(UnityEngine.Object[] objects) { var drag = UnityEditor.DragAndDrop.objectReferences[0]; Debug.Log(drag.GetType().ToString()); if (drag is MAction) { Debug.Log("drag is MAction"); a = drag as MAction; draggedType = drag.GetType(); dragAcceptPending = true; } if (drag is MGoal) { Debug.Log("drag is goal"); g = drag as MGoal; draggedType = drag.GetType(); dragAcceptPending = true; } if (drag is MNorm) { Debug.Log("drag is norm"); n = drag as MNorm; draggedType = drag.GetType(); dragAcceptPending = true; } Vector2 pos = NodeEditorWindow.current.WindowToGridPosition(Event.current.mousePosition); // dragged = objects; }
void acceptDraggedNorm(Type type, MNorm norm) { if (dragAcceptPending) { if (Event.current.type == EventType.Repaint) { //var act = act; Convert.ChangeType(norm, type); Vector2 pos = NodeEditorWindow.current.WindowToGridPosition(Event.current.mousePosition); // NewNodeGraph graph = target as NewNodeGraph; NormNode nn = CreateNode(typeof(NormNode), pos) as NormNode; nn.sourceNorm = norm; nn.normtype = norm.GetType(); nn.action = norm.targetAction; nn.context = nn.populateFilter(nn.context, norm.context, PortOrientation.In); Debug.Log("Dragged norm"); dragAcceptPending = false; n = null; draggedType = null; } } }
protected void LoadEntity(MNorm entity) { if (entity != null) { EntityId = entity.MNormId; Name = entity.Name; SortId = entity.SortId; Status = entity.Status; PostDate = entity.PostDate; Content = entity.Content; MainCode = entity.MainCode; MainName = entity.MainName; AdminCode = entity.AdminCode; AdminName = entity.AdminName; ServiceCode = entity.ServiceCode; ServiceName = entity.ServiceName; } }
public ActionResult SetSort(string entityId, string sortValue) { AjaxResult result = new AjaxResult(AjaxResultStatus.Success, string.Empty); StringBuilder sbMsg = new StringBuilder(); try { MNorm entity = m_FTISService.GetMNormById(Convert.ToInt32(entityId)); entity.SortId = int.Parse(sortValue); m_FTISService.UpdateMNorm(entity); } catch (Exception ex) { result.ErrorCode = AjaxResultStatus.Fail; sbMsg.AppendFormat(ex.Message + "<br/>"); } result.Message = sbMsg.ToString(); return(this.Json(result)); }
public ActionResult Delete(int id) { AjaxResult result = new AjaxResult(); try { MNorm entity = m_FTISService.GetMNormById(id); m_FTISService.DeleteMNorm(entity); result.ErrorCode = AjaxResultStatus.Success; result.Message = string.Format("{0}刪除成功", entity.Name); } catch (Exception ex) { result.ErrorCode = AjaxResultStatus.Exception; result.Message = ex.Message; } return(this.Json(result)); }
public ActionResult MultiDelete(string allId) { AjaxResult result = new AjaxResult(AjaxResultStatus.Success, string.Empty); StringBuilder sbMsg = new StringBuilder(); string[] ids = allId.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (string id in ids) { try { MNorm entity = m_FTISService.GetMNormById(Convert.ToInt32(id)); m_FTISService.DeleteMNorm(entity); } catch (Exception ex) { result.ErrorCode = AjaxResultStatus.Fail; sbMsg.AppendFormat(ex.Message + "<br/>"); } } result.Message = sbMsg.ToString(); return(this.Json(result)); }
public void Update() { MNorm entity = m_FTISService.GetMNormById(EntityId); Save(entity); }
public void Insert() { MNorm entity = new MNorm(); Save(entity); }
protected void LoadEntity(int id) { MNorm entity = m_FTISService.GetMNormById(id); LoadEntity(entity); }