private void mnuMasterRefAdd_Click(object sender, RoutedEventArgs e) { CComboConfig cfg = (CComboConfig)comboTypeConfigs[ComboLoadType]; ObservableCollection <MBaseModel> arr = new ObservableCollection <MBaseModel>(); MasterRefEnum rt = (MasterRefEnum)int.Parse(cfg.Type); //WinAddEditMasterRef w = new WinAddEditMasterRef(rt); //w.Caption = (String)(sender as MenuItem).Header + " " + Caption; //w.SetMasterRefType(rt); //w.Mode = "A"; //w.ParentItemSource = arr; //w.ShowDialog(); String caption = CLanguage.getValue("add") + " " + Caption; CWinLoadParam param = new CWinLoadParam(); param.Caption = caption; param.GenericType = cfg.Type; param.Mode = "A"; param.ParentItemSources = arr; Boolean isOK = FactoryWindow.ShowWindow("WinAddEditMasterRef", param); if (isOK) { CMasterReference.LoadAllMasterRefItems(OnixWebServiceAPI.GetAllMasterRefList, rt); } }
private void WinMain_OnLoad(object sender, RoutedEventArgs e) { CConfig.ConfigRead(); initStatusBar(); WinLogin wLogin = new WinLogin(); wLogin.ShowDialog(); Boolean isOK = wLogin.LoginOK; if (isOK) { stbiUserValue.Content = OnixWebServiceAPI.GetLastUserLogin(); isLogin = true; configureMenu(); //Load user variables if (!OnixWebServiceAPI.UserID().Equals("")) { currentUser = new CTable("USER"); currentUser.SetFieldValue("USER_ID", OnixWebServiceAPI.UserID()); currentUser = OnixWebServiceAPI.GetUserInfo(currentUser); CConfig.LoadLastValueSaved(currentUser); } CReportFactory.InitReports(); CMasterReference.LoadCompanyProfile(); CGlobalVariable.InitGlobalVariables(); CMasterReference.LoadAllMasterRefItems(OnixWebServiceAPI.GetAllMasterRefList); CUtil.ExportLoadingImage(); } }
public void InitPackageBranches() { package_branches.Clear(); CTable o = GetDbObject(); ArrayList arr = o.GetChildArray("PACKAGE_BRANCH_ITEM"); if (arr == null) { arr = new ArrayList(); o.AddChildArray("PACKAGE_BRANCH_ITEM", arr); } Hashtable temp = new Hashtable(); foreach (CTable t in arr) { MPackageBranch v = new MPackageBranch(t); package_branches.Add(v); temp[v.BranchId] = "dummy"; v.ExtFlag = "I"; v.Seq = internalSeq; internalSeq++; } if (!CMasterReference.IsMasterRefLoad(MasterRefEnum.MASTER_BRANCH)) { CMasterReference.LoadAllMasterRefItems(OnixWebServiceAPI.GetMasterRefList); } foreach (MMasterRef mr in CMasterReference.Instance.Branches) { if (mr.MasterID.Equals("")) { continue; } if (temp.ContainsKey(mr.MasterID)) { continue; } MPackageBranch v = new MPackageBranch(new CTable("")); v.Code = mr.Code; v.Name = mr.Description; v.BranchId = mr.MasterID; v.ExtFlag = "A"; package_branches.Add(v); arr.Add(v.GetDbObject()); v.Seq = internalSeq; internalSeq++; } }
private void loadRelatedReferences() { if (!CMasterReference.IsCashAccountLoad()) { CMasterReference.LoadCashAccount(OnixWebServiceAPI.GetCashAccountList); } if (!CMasterReference.IsLocationLoad()) { CMasterReference.LoadLocation(true, null); } if (!CMasterReference.IsMasterRefLoad(MasterRefEnum.MASTER_BRANCH)) { CMasterReference.LoadAllMasterRefItems(OnixWebServiceAPI.GetMasterRefList); } }
private void refreshMasterRef() { CMasterReference.LoadAllMasterRefItems(OnixWebServiceAPI.GetMasterRefList); }