}//end static method public static Context CreateInstanceFromCache(this Context ctx, string dataCenterId, long userId) { Context contextByDataCenterId = DataCenterService.GetDataCenterContextFromCache(dataCenterId); //处理用户登录名 { FormMetadata metadata = FormMetaDataCache.GetCachedFormMetaData(contextByDataCenterId, FormIdConst.SEC_User); BusinessInfo businessInfo = metadata.BusinessInfo.GetSubBusinessInfo(new List <string> { "FNumber", "FUserAccount", "FName" }); DynamicObject dataObject = BusinessDataServiceHelper.LoadFromCache(contextByDataCenterId, new object[] { userId }, businessInfo.GetDynamicObjectType()).FirstOrDefault(); contextByDataCenterId.UserId = dataObject.PkId <long>(); if (businessInfo.GetField("FNumber") != null) { contextByDataCenterId.LoginName = dataObject.FieldProperty <string>(businessInfo.GetField("FNumber")); } if (businessInfo.GetField("FUserAccount") != null) { contextByDataCenterId.LoginName = dataObject.FieldProperty <string>(businessInfo.GetField("FUserAccount")); } contextByDataCenterId.UserName = dataObject.FieldProperty <string>(businessInfo.GetField("FName")); } return(contextByDataCenterId); }//end static method
public useradminController(IAccountRepository _rightRepository, IDataCenterRepository _datacenterRepository, IMaterialRepository _materialRepository, ICostanalysisRepository _costanalysisRepository) { accountService = new AccountService(_rightRepository); centerService = new DataCenterService(_datacenterRepository); materialService = new MaterialService(_materialRepository); costanalysisService = new CostanalysisService(_costanalysisRepository); }
public HomeController(IDataCenterRepository _centerRepository, IMaterialRepository _materialRepository, IAccountRepository _rightRepository, IManagementRepository _managementRepository) { centerService = new DataCenterService(_centerRepository); accountService = new AccountService(_rightRepository); materialService = new MaterialService(_materialRepository); managementService = new ManagementService(_managementRepository); }
public virtual ServiceResult Invoke(string featureId = "") { var result = new ServiceResult <List <DataCenterInfoOutput> >(); try { bool flag = DataCenterService.IsDeployAsPublicCloud(this.KDContext.Session.AppContext); string host = flag ? this.KDContext.WebContext.Context.Request.Url.Host : string.Empty; var infos = DataCenterService.GetDataCentersFromMC(string.Empty, Context.DataBaseCategory.Normal, string.Empty, host); if (!featureId.IsNullOrEmptyOrWhiteSpace() && infos.Any()) { var ctx = this.KDContext.Session.AppContext; ctx = ctx.CreateAdministratorFromCache(infos.First().Id); FeatureVerifier.CheckFeature(ctx, featureId); }//end if result.Code = (int)ResultCode.Success; result.Message = ResultCode.Success.ToString(); result.Data = infos.Select(db => new DataCenterInfoOutput { Id = db.Id, Number = db.Number, Name = db.Name }).ToList(); } catch (Exception ex) { result.Code = (int)ResultCode.Fail; result.Message = ex.Message; } return(result); } //end method
}//end static method public static Context CreateAdministratorFromCache(this Context ctx, string dataCenterId) { Context contextByDataCenterId = DataCenterService.GetDataCenterContextFromCache(dataCenterId); contextByDataCenterId.UserId = FormConst.AdministratorID; contextByDataCenterId.UserName = "******"; return(contextByDataCenterId); }//end static method
/// <summary> /// Gets the network limits. /// </summary> /// <returns>The network limits</returns> public Task <NetworkLimits> GetNetworkLimits(CancellationToken cancellationToken) { if (!HasNetworkLimits) { return(null); } return(DataCenterService.GetNetworkLimitsByLink(string.Format("{0}{1}", Configuration.BaseUri, networkLimitsLink.Value.Href), cancellationToken)); }
public void GetAcceptOffNameByIdTest() { DataCenterService target = new DataCenterService(); // TODO: Initialize to an appropriate value string acceptOffCode = "111"; // TODO: Initialize to an appropriate value ResponseService <string> expected = null; // TODO: Initialize to an appropriate value ResponseService <string> actual; actual = target.GetAcceptOffNameById(acceptOffCode); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void GetCompanyNameByIdToTextTest() { DataCenterService target = new DataCenterService(); // TODO: Initialize to an appropriate value string compCode = string.Empty; // TODO: Initialize to an appropriate value ResponseService <string> expected = null; // TODO: Initialize to an appropriate value ResponseService <string> actual; actual = target.GetCompanyNameByIdToText(compCode); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void GetTitleNameFromSexTest() { DataCenterService target = new DataCenterService(); // TODO: Initialize to an appropriate value string sex = "M"; // TODO: Initialize to an appropriate value ResponseService <List <TitleName> > expected = null; // TODO: Initialize to an appropriate value ResponseService <List <TitleName> > actual; actual = target.GetTitleNameFromSex(sex); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void GetSpecialDocTypeTest() { DataCenterService target = new DataCenterService(); // TODO: Initialize to an appropriate value string docStatus = "A"; // TODO: Initialize to an appropriate value string trainStatus = "Y"; // TODO: Initialize to an appropriate value ResponseService <List <SpecialDocument> > expected = null; // TODO: Initialize to an appropriate value ResponseService <List <SpecialDocument> > actual; actual = target.GetSpecialDocType(docStatus, trainStatus); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
}//end constructor /// <summary> /// 获取业务数据中心。 /// </summary> /// <returns>返回服务端结果。</returns> public virtual ServiceResult <List <object> > GetDataCenterList() { var result = new ServiceResult <List <object> >(); try { var infos = DataCenterService.GetDataCentersFromMC(string.Empty, Context.DataBaseCategory.Normal); result.Code = (int)ResultCode.Success; result.Message = string.Format("成功返回{0}个数据中心!", infos.Count); result.Data = infos.Select(db => new { Id = db.Id, Number = db.Number, Name = db.Name }).Cast <object>().ToList(); } catch (Exception ex) { result.Code = (int)ResultCode.Fail; result.Message = ex.Message; } return(result); } //end method
public performanceController(IDataCenterRepository _centerRepository) { centerService = new DataCenterService(_centerRepository); }
public processparaController(IDataCenterRepository _centerRepository) { centerService = new DataCenterService(_centerRepository); }
public datacenterController(IDataCenterRepository _centerRepository) { centerService = new DataCenterService(_centerRepository); }
public waterqualityController(IDataCenterRepository _centerRepository) { centerService = new DataCenterService(_centerRepository); }
public waterregulaController(IDataCenterRepository _centerRepository) { centerService = new DataCenterService(_centerRepository); }
public partialpageController(IDataCenterRepository _centerRepository) { centerService = new DataCenterService(_centerRepository); }