/// <summary> /// 添加成员 /// </summary> /// <param name="organizationUnit"></param> /// <returns></returns> private async Task AddMember(OrganizationListModel organizationUnit) { if (organizationUnit == null) { return; } long Id = organizationUnit.Id; await WebRequest.Execute(() => appService.FindUsers(new FindOrganizationUnitUsersInput() { OrganizationUnitId = Id }), async result => { DialogParameters param = new DialogParameters(); param.Add("Id", Id); param.Add("Value", result); var dialogResult = await dialog.ShowDialogAsync(AppViewManager.AddUsers, param); if (dialogResult.Result == ButtonResult.OK) { await GetOrganizationUnitUsers(usersInput); } }); }
public OrganizationListModel RetrieveOrganizations() { var pms = _repository.FindAll(); var pmListModel = new OrganizationListModel(pms, _hostName); return(pmListModel); }
public ActionResult List() { var model = new OrganizationListModel { Items = _organizationRepository.Select(new Repository.Filter.OrganizationFilter { }) }; return(View(model)); }
/// <summary> /// 删除组织机构 /// </summary> /// <param name="organization"></param> public async void DeleteOrganizationUnit(OrganizationListModel organization) { if (await dialog.Question(Local.Localize("OrganizationUnitDeleteWarningMessage", organization.DisplayName))) { await WebRequest.Execute(() => appService.DeleteOrganizationUnit(new EntityDto <long>() { Id = organization.Id }), RefreshAsync); } }
public OrganizationListModel Retrieve(string raisonSociale, string internalReference, string externalReference) { var listPMs = new List <Organization>(); listPMs.Add(new Organization(1, "1", "The First Test Company")); listPMs.Add(new Organization(2, "2", "The Second Test Company")); listPMs.Add(new Organization(3, "3", "The Third Test Company")); var results = new OrganizationListModel(listPMs, string.Empty); return(results); }
/// <summary> /// 编辑组织机构 /// </summary> /// <param name="organization"></param> public async void EditOrganizationUnit(OrganizationListModel organization) { DialogParameters param = new DialogParameters(); param.Add("Value", organization); var dialogResult = await dialog.ShowDialogAsync("OrganizationsAddView", param); if (dialogResult.Result == ButtonResult.OK) { await RefreshAsync(); } }
/// <summary> /// 选中组织机构-更新成员和角色信息 /// </summary> /// <param name="organizationUnit"></param> private async void Selected(OrganizationListModel organizationUnit) { if (organizationUnit == null) { return; } SelectedOrganizationUnit = organizationUnit; rolesInput.Id = SelectedOrganizationUnit.Id; usersInput.Id = SelectedOrganizationUnit.Id; await GetOrganizationUnitUsers(usersInput); await GetOrganizationUnitRoles(rolesInput); }
/// <summary> /// 新增组织机构 /// </summary> /// <param name="organization"></param> public async void AddOrganizationUnit(OrganizationListModel organization = null) { DialogParameters param = new DialogParameters(); if (organization != null) { param.Add("ParentId", organization.Id); } var dialogResult = await dialog.ShowDialogAsync("OrganizationsAddView", param); if (dialogResult.Result == ButtonResult.OK) { await RefreshAsync(); } }
public override void OnDialogOpened(IDialogParameters parameters) { if (parameters.ContainsKey("Value")) { Input = parameters.GetValue <OrganizationListModel>("Value"); } else { IsNewOrganization = true; Input = new OrganizationListModel(); } if (parameters.ContainsKey("ParentId")) { ParentId = parameters.GetValue <long>("ParentId"); } }
public void WhenISearchAnOrganization() { //// Exercise SUT var browser = new Browser(with => { with.Module(new OrganizationQueryModule(new OrganizationRepository())); with.ViewFactory <TestViewFactory>(); }); var response = browser.Get("/Organization", (with) => { with.Header("content-type", "application/json"); with.HttpRequest(); }); Assert.Equal(HttpStatusCode.OK, response.StatusCode); _actualOrganizations = response.Context.Items["Model"] as OrganizationListModel; }
public void GivenIHaveThisFollowingOrganizationsInTheSearchList(Table table) { var browser = new Browser(with => { with.Module(new OrganizationQueryModule(new OrganizationRepository())); with.ViewFactory <TestViewFactory>(); }); var response = browser.Get("/organization", (with) => { with.Header("content-type", "application/json"); with.HttpRequest(); }); Assert.Equal(HttpStatusCode.OK, response.StatusCode); _allOrganizations = response.Context.Items["Model"] as OrganizationListModel; Assert.NotNull(_allOrganizations); Assert.NotEmpty(_allOrganizations.Items); }
public HospitalFacilityListModel Create(IEnumerable <HospitalFacility> hospitalFacilities, OrganizationListModel orgListModel, IEnumerable <OrderedPair <long, string> > contracts, IEnumerable <OrderedPair <long, long> > hospitalPartnerIdHospitalFacilityIdPairs) { var model = new HospitalFacilityListModel(); var basicModels = new HospitalFacilityViewModel[hospitalFacilities.Count()]; var index = 0; foreach (var hospitalFacility in hospitalFacilities) { long parentHospitalPartnerId = 0; if (hospitalPartnerIdHospitalFacilityIdPairs != null && hospitalPartnerIdHospitalFacilityIdPairs.Any()) { parentHospitalPartnerId = hospitalPartnerIdHospitalFacilityIdPairs.Where(hphf => hphf.SecondValue == hospitalFacility.Id).Select(hphf => hphf.FirstValue).SingleOrDefault(); } basicModels[index++] = new HospitalFacilityViewModel() { Contract = contracts.Where(c => c.FirstValue == hospitalFacility.Id).Select(c => c.SecondValue).FirstOrDefault(), OrganizationBasicInfoModel = orgListModel.Organizations.FirstOrDefault(o => o.Id == hospitalFacility.Id), ParentHospitalPartner = parentHospitalPartnerId > 0 ? orgListModel.Organizations.First(o => o.Id == parentHospitalPartnerId).Name : string.Empty }; } model.HospitalFacilities = basicModels; return(model); }
public CorporateAccountListModel Create(IEnumerable <CorporateAccount> accounts, IEnumerable <OrderedPair <long, string> > accountIdPackagesPair, OrganizationListModel orgListModel) { var model = new CorporateAccountListModel(); var basicModels = new CorporateAccountModel[accounts.Count()]; var index = 0; foreach (var account in accounts) { basicModels[index++] = new CorporateAccountModel { ContractNotes = account.ContractNotes, DefaultPackages = accountIdPackagesPair != null?accountIdPackagesPair.Where(ap => ap.FirstValue == account.Id).Select(ap => ap.SecondValue).ToArray() : null, OrganizationBasicInfoModel = orgListModel.Organizations.FirstOrDefault(o => o.Id == account.Id), IsHealthPlan = account.IsHealthPlan }; } model.CorporateAccounts = basicModels; return(model); }
public void SearchingAnOrganizationBytheCorporateNameExactMatch(string raisonSociale, string internalReference, string externalReference, OrganizationRetrieverFake retriever, OrganizationListModel answer) { "Given I have an organization with the corporate name {0} " .x(() => { }); "When I search with the corporate name {0} " .x(() => { retriever = new OrganizationRetrieverFake(); answer = retriever.Retrieve(raisonSociale, internalReference, externalReference); }); "search result contains an organization with the expected corporate name {0}" .x(() => { Assert.NotNull(answer); Assert.NotEmpty(answer.Items); var actual = answer.Items.FirstOrDefault(); Assert.NotNull(actual); actual.RaisonSociale.Should().Be(raisonSociale); }); }
public MedicalVendorListModel Create(IEnumerable <MedicalVendor> medicalVendors, OrganizationListModel orgListModel, IEnumerable <OrderedPair <long, string> > contracts) { var model = new MedicalVendorListModel(); var basicModels = new MedicalVendorModel[medicalVendors.Count()]; var index = 0; foreach (var medicalVendor in medicalVendors) { basicModels[index++] = new MedicalVendorModel() { Contract = contracts.Where(c => c.FirstValue == medicalVendor.Id).Select( c => c.SecondValue).FirstOrDefault(), MedicalVendorType = medicalVendor.MedicalVendorType, OrganizationBasicInfoModel = orgListModel.Organizations.Where(o => o.Id == medicalVendor.Id). FirstOrDefault() }; } model.MedicalVendors = basicModels; return(model); }
public IActionResult OrganizationList() { var model = new OrganizationListModel(); return(View(model)); }
/// <summary> /// Loads the appointment page and fill the appointments of the current moth /// </summary> /// <param name="o"></param> /// <param name="e"></param> void Page_Load(Object o, EventArgs e) { var franchisorMaster = (Franchisor_FranchisorMaster)this.Master; this.Page.Title = "View Calendar"; franchisorMaster.settitle("View Calendar"); franchisorMaster.SetBreadCrumbRoot = "<a href=\"#\">DashBoard</a>"; franchisorMaster.setCalendarUC(); franchisorMaster.hideucsearch(); if (!IsPostBack) { var strJs = new System.Text.StringBuilder(); strJs.Append(" <script language = 'Javascript'>setContextMenu('Year'); </script>"); ScriptManager.RegisterStartupScript(this.Page, typeof(string), "JSCode", strJs.ToString(), false); var tbltemp = new DataTable(); tbltemp.Columns.Add("Name"); tbltemp.Columns.Add("Address"); tbltemp.Columns.Add("FranchiseeID"); OrganizationListModel eFranchisees = null; OrganizationEditModel eFranchisee = null; if (CurrentRole == Roles.FranchisorAdmin) { var listFranchisee = IoC.Resolve <IOrganizationService>().GetOrganizationListModel(OrganizationType.Franchisee); if (listFranchisee != null) { eFranchisees = listFranchisee; foreach (OrganizationBasicInfoModel franchisee in eFranchisees.Organizations) { tbltemp.Rows.Add(new object[] { franchisee.Name, franchisee.Address.ToString(), franchisee.Id }); } } } else //if (_userShellModuleRole.ShellType == "Franchisee") { grdFranchisee.Enabled = false; // Need to replace t with the ListModel instead of Edit Model OrganizationEditModel listFranchisee = IoC.Resolve <IOrganizationService>().GetOrganizationCreateModel(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationId); if (listFranchisee != null) { eFranchisee = listFranchisee; tbltemp.Rows.Add(new object[] { eFranchisee.Name, eFranchisee.BusinessAddress.ToString(), eFranchisee.Id }); } } if (CurrentRole == Roles.SalesRep) { sBloack.Visible = false; pnlAddFranchisee.Visible = false; } grdFranchisee.DataSource = tbltemp; grdFranchisee.DataBind(); if (CurrentRole == Roles.SalesRep || CurrentRole == Roles.FranchiseeAdmin) { ((CheckBox)grdFranchisee.Rows[0].Cells[0].FindControl("chkboxitem")).Checked = true; } SetPageForRole(); } }