private static void dds_LoadedData(object sender, LoadedDataEventArgs geted) { if (geted.HasError) { USysFlag.IsReadyRight = true; geted.MarkErrorAsHandled(); return; } Rights.Clear(); V_S_Function t = null; foreach (V_S_Function item in geted.Entities) { t = new V_S_Function() { F_Open = item.F_Open, FunCode = item.FunCode, FunID = item.FunID, FunName = item.FunName, FunPID = item.FunPID, ImageURL = item.ImageURL, F_Explan = item.F_Explan, F_ShowInMenu = item.F_ShowInMenu, FunRight = item.FunRight, }; Rights.Add(t); } USysFlag.IsReadyRight = true; }
private void ResetAllMsg(V_S_Function obj) { obj.Msg = ""; obj.Children.ForEach(item => { item.Msg = ""; ResetAllMsg(item); }); }
private IEnumerable <V_S_Function> GetItems(V_S_Function obj) { yield return(obj); foreach (V_S_Function obj2 in obj.Children.SelectMany(item => GetItems(item))) { yield return(obj2); } }
private void SetChildIsSelect(V_S_Function obj, bool isselect) { obj.Children.ForEach(item => { item.Msg = ErpUIText.Get("ERP_Msg"); item.IsSelected = isselect; updateCodes.Add(item.FunCode); SetChildIsSelect(item, isselect); }); }
public void InsertV_S_Function(V_S_Function v_S_Function) { if ((v_S_Function.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(v_S_Function, EntityState.Added); } else { this.ObjectContext.V_S_Function.AddObject(v_S_Function); } }
public void DeleteV_S_Function(V_S_Function v_S_Function) { if ((v_S_Function.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(v_S_Function, EntityState.Deleted); } else { this.ObjectContext.V_S_Function.Attach(v_S_Function); this.ObjectContext.V_S_Function.DeleteObject(v_S_Function); } }
private void ddsTreeView_LoadedData(object sender, LoadedDataEventArgs geted) { this.IsBusy = false; if (geted.HasError) { MessageErp.ErrorMessage(geted.Error.Message.GetErrMsg()); geted.MarkErrorAsHandled(); return; } var items = geted.Entities; this.SourceTree.Clear(); V_S_Function it; items.ToList().ForEach(item => { if (!string.IsNullOrEmpty(((V_S_Function)item).FunParentID)) { return; } it = new V_S_Function(); ComCopyProperties.Copy(it, item); it.I_Explan = true; it.Children = GetChild(items, ((V_S_Function)item).FunID); this.SourceTree.Add(it); }); //////////////////////////////////////////// var ddsInfo = new ComDDsInfo() { Domaincontext = ComDSFactory.Man, QueryName = UDSMethods.V_S_FunctionAuthorityList, PageSize = 0 }; ddsInfo.Parameters.Add(new ComParameters() { ParameterName = "groupID", Value = this._gID }); var dds = ComDDSFactory.Get(ddsInfo, null, ddsAuthorityTree_LoadedData); this.IsBusy = true; dds.Load(); }
public void UpdateV_S_Function(V_S_Function currentV_S_Function) { this.ObjectContext.V_S_Function.AttachAsModified(currentV_S_Function, this.ChangeSet.GetOriginal(currentV_S_Function)); }