当前位置: 首页>>代码示例>>C#>>正文


C# BusinessLogic类代码示例

本文整理汇总了C#中BusinessLogic的典型用法代码示例。如果您正苦于以下问题:C# BusinessLogic类的具体用法?C# BusinessLogic怎么用?C# BusinessLogic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BusinessLogic类属于命名空间,在下文中一共展示了BusinessLogic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

        public void SetUp()
        {
            products = new List<Product>();
              companies = new List<Company>();
              acquisitions = new List<Acquisition>();
              acquisitionItems = new List<AcquisitionItem>();
              sales = new List<Sale>();
              saleItems = new List<SaleItem>();
              stocks = new List<Stock>();

              repository = new Mock<Repository>();
              repository.SetUpTable(it => it.Products, products);
              repository.SetUpTable(it => it.Companies, companies);
              repository.SetUpTable(it => it.Acquisitions, acquisitions);
              repository.SetUpTable(it => it.AcquisitionItems, acquisitionItems);
              repository.SetUpTable(it => it.Sales, sales);
              repository.SetUpTable(it => it.SaleItems, saleItems);
              repository.SetUpTable(it => it.Stocks, stocks);

              repository
            .Setup(it => it.SaveChanges())
            .Callback(() =>
            {
              acquisitions.ForEach(FixItems);
              sales.ForEach(FixItems);
            });
              transaction = new Mock<TransactionBlock>();
              repository
            .Setup(it => it.CreateTransaction(It.IsAny<IsolationLevel>()))
            .Returns(transaction.Object);

              sut = new BusinessLogic(() => repository.Object);
        }
开发者ID:njmube,项目名称:public,代码行数:33,代码来源:BusinessLogicTests.cs

示例2: MakeNew

 public static StylesheetProperty MakeNew(string Text, StyleSheet sheet, BusinessLogic.User user) {
     CMSNode newNode = CMSNode.MakeNew(sheet.Id, moduleObjectType, user.Id, 2, Text, Guid.NewGuid());
     SqlHelper.ExecuteNonQuery(String.Format("Insert into cmsStylesheetProperty (nodeId,stylesheetPropertyAlias,stylesheetPropertyValue) values ('{0}','{1}','')", newNode.Id, Text));
     StylesheetProperty ssp = new StylesheetProperty(newNode.Id);
     NewEventArgs e = new NewEventArgs();
     ssp.OnNew(e);
     return ssp;
 }
开发者ID:Jeavon,项目名称:Umbraco-CMS,代码行数:8,代码来源:StylesheetProperty.cs

示例3: PromoModel

        public PromoModel(BusinessLogic.AccountBase accountBase, Guid? promoId)
        {
            // TODO: Complete member initialization
            this.AccountBase = accountBase;
            this.PromoId = promoId;

            Setup();
        }
开发者ID:akoesnan,项目名称:PraLoup,代码行数:8,代码来源:PromoModel.cs

示例4: PromoIndexModel

        public PromoIndexModel(BusinessLogic.AccountBase accountBase, Guid? businessId, string businessName)
        {
            // TODO: Complete member initialization
            this.AccountBase = accountBase;
            this.BusinessId = businessId;
            this.BusinessName = businessName;

            Setup();
        }
开发者ID:akoesnan,项目名称:PraLoup,代码行数:9,代码来源:PromoIndexModel.cs

示例5: UpdateCruds

		public static void UpdateCruds(BusinessLogic.User User, Cms.BusinessLogic.CMSNode Node, string Permissions) 
		{
			// delete all settings on the node for this user
			Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(GlobalSettings.DbDSN, CommandType.Text, "delete from umbracoUser2NodePermission where userId = @userId and nodeId = @nodeId", new SqlParameter("@userId", User.Id), new SqlParameter("@nodeId", Node.Id)); 

			// Loop through the permissions and create them
			foreach (char c in Permissions.ToCharArray())
				MakeNew(User, Node, c);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:9,代码来源:Permission.cs

示例6: AutoMergeController

 public AutoMergeController(BusinessLogic.AutoMerge.Base.IInsert insertBLL,
                             BusinessLogic.AutoMerge.Base.ITrigger triggerBLL,
                             BusinessLogic.AutoMerge.Base.IUpdate updateBLL,
                             BusinessLogic.AutoMerge.Base.ISelect selectBLL)
 {
     this.insertBLL = insertBLL;
     this.triggerBLL = triggerBLL;
     this.updateBLL = updateBLL;
     this.selectBLL = selectBLL;
 }
开发者ID:kwmcrell,项目名称:SourceManager,代码行数:10,代码来源:AutoMergeController.cs

示例7: Trigger

 public Trigger(BusinessLogic.AutoMerge.Base.ISelect selectAutoMergeBLL,
                 BusinessLogic.Notifications.Base.ISend notificationsSendBLL,
                 BusinessLogic.Core.Base.ISettings settingsBLL,
                 BusinessLogic.AutoMergeLog.Base.IInsert insertLogBLL)
 {
     this.selectAutoMergeBLL = selectAutoMergeBLL;
     this.notificationsSendBLL = notificationsSendBLL;
     this.settingsBLL = settingsBLL;
     this.insertLogBLL = insertLogBLL;
 }
开发者ID:kwmcrell,项目名称:SourceManager,代码行数:10,代码来源:Trigger.cs

示例8: MakeNew

		public static StyleSheet MakeNew(BusinessLogic.User user, string Text, string FileName, string Content) 
		{
			
			// Create the Umbraco node
			CMSNode newNode = CMSNode.MakeNew(-1, moduleObjectType, user.Id, 1, Text, Guid.NewGuid());

			// Create the stylesheet data
			Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(_ConnString, CommandType.Text, "insert into cmsStylesheet (nodeId, filename, content) values ('" + newNode.Id.ToString() + "','" + FileName + "',@content)", new SqlParameter("@content", Content));
			
			return new StyleSheet(newNode.UniqueId);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:11,代码来源:StyleSheet.cs

示例9: DoHandleMedia

        public override void DoHandleMedia(Media media, PostedMediaFile postedFile, BusinessLogic.User user)
        {
            // Get Image object, width and height
            var image = System.Drawing.Image.FromStream(postedFile.InputStream);
            var fileWidth = image.Width;
            var fileHeight = image.Height;

            // Get umbracoFile property
            var propertyId = media.getProperty("umbracoFile").Id;

            // Get paths
            var destFileName = ConstructDestFileName(propertyId, postedFile.FileName);
            var destPath = ConstructDestPath(propertyId);
            var destFilePath = VirtualPathUtility.Combine(destPath, destFileName);
            var ext = VirtualPathUtility.GetExtension(destFileName).Substring(1);

            var absoluteDestPath = HttpContext.Current.Server.MapPath(destPath);
            var absoluteDestFilePath = HttpContext.Current.Server.MapPath(destFilePath);

            // Set media properties
            media.getProperty("umbracoFile").Value = destFilePath;
            media.getProperty("umbracoWidth").Value = fileWidth;
            media.getProperty("umbracoHeight").Value = fileHeight;
            media.getProperty("umbracoBytes").Value = postedFile.ContentLength;

            if (media.getProperty("umbracoExtension") != null)
                media.getProperty("umbracoExtension").Value = ext;

            if (media.getProperty("umbracoExtensio") != null)
                media.getProperty("umbracoExtensio").Value = ext;

            // Create directory
            if (UmbracoSettings.UploadAllowDirectories)
                Directory.CreateDirectory(absoluteDestPath);

            // Generate thumbnail
            var thumbDestFilePath = Path.Combine(absoluteDestPath, Path.GetFileNameWithoutExtension(destFileName) + "_thumb");
            GenerateThumbnail(image, 100, fileWidth, fileHeight, thumbDestFilePath + ".jpg");

            // Generate additional thumbnails based on PreValues set in DataTypeDefinition uploadField
            GenerateAdditionalThumbnails(image, fileWidth, fileHeight, thumbDestFilePath);

            image.Dispose();

            // Save file
            postedFile.SaveAs(absoluteDestFilePath);

            // Close stream
            postedFile.InputStream.Close();

            // Save media
            media.Save();
        }
开发者ID:jracabado,项目名称:justEdit-,代码行数:53,代码来源:UmbracoImageMediaFactory.cs

示例10: Select

 public Select(DataAccess.AutoMerge.Base.ISelect selectDAL, 
                 BusinessLogic.Branch.Base.ISelect branchSelectBLL,
                 BusinessLogic.AutoMergeSubscription.Base.ISelect autoMergeSubscriptionBLL,
                 BusinessLogic.AutoMergeOptions.Base.ISelect autoMergeOptionsBLL,
                 BusinessLogic.AutoMergeLog.Base.ISelect autoMergeLogSelectBLL)
 {
     this.selectDAL = selectDAL;
     this.branchSelectBLL = branchSelectBLL;
     this.autoMergeSubscriptionBLL = autoMergeSubscriptionBLL;
     this.autoMergeOptionsBLL = autoMergeOptionsBLL;
     this.autoMergeLogSelectBLL = autoMergeLogSelectBLL;
 }
开发者ID:kwmcrell,项目名称:SourceManager,代码行数:12,代码来源:Select.cs

示例11: MakeNew

		/// <summary>
		/// Create a new MemberType
		/// </summary>
		/// <param Name="Text">The Name of the MemberType</param>
		/// <param Name="u">Creator of the MemberType</param>
		public static MemberType MakeNew( BusinessLogic.User u,string Text) 
		{
		
			int ParentId= -1;
			int level = 1;
			Guid uniqueId = Guid.NewGuid();
			CMSNode n = CMSNode.MakeNew(ParentId, _objectType, u.Id, level,Text, uniqueId);

			ContentType.Create(n.Id, Text,"");
	
			return new MemberType(n.Id);
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:17,代码来源:MemberType.cs

示例12: MakeNew

 public static ContentItem MakeNew(string Name, ContentItemType cit, BusinessLogic.User u, int ParentId)
 {
     Guid newId = Guid.NewGuid();
     // Updated to match level from base node
     CMSNode n = new CMSNode(ParentId);
     int newLevel = n.Level;
     newLevel++;
     CMSNode.MakeNew(ParentId,_objectType, u.Id, newLevel,  Name, newId);
     ContentItem tmp = new ContentItem(newId);
     tmp.CreateContent(cit);
     return tmp;
 }
开发者ID:jracabado,项目名称:justEdit-,代码行数:12,代码来源:ContentItem.cs

示例13: Update

 public Update(DataAccess.AutoMerge.Base.IUpdate updateDAL, Branch.Base.IInsert insertBranchBLL,
                 BusinessLogic.AutoMergeSubscription.Base.IUpsert autoMergeSubscriptionUpsertBLL,
                 BusinessLogic.AutoMerge.Base.ISchedule scheduleBLL,
                 BusinessLogic.AutoMergeOptions.Base.IUpsert autoMergeOptionsUpsertBLL,
                 BusinessLogic.AutoMerge.Base.ISelect selectAutoMergeBLL)
 {
     this.updateDAL = updateDAL;
     this.insertBranchBLL = insertBranchBLL;
     this.autoMergeSubscriptionUpsertBLL = autoMergeSubscriptionUpsertBLL;
     this.scheduleBLL = scheduleBLL;
     this.autoMergeOptionsUpsertBLL = autoMergeOptionsUpsertBLL;
     this.selectAutoMergeBLL = selectAutoMergeBLL;
 }
开发者ID:kwmcrell,项目名称:SourceManager,代码行数:13,代码来源:Update.cs

示例14: Insert

        public Insert(DataAccess.AutoMerge.Base.IInsert insertDAL, 
                        BusinessLogic.Branch.Base.ISelect branchSelectBLL,
                        BusinessLogic.Branch.Base.IInsert insertBranchBLL,
                        BusinessLogic.AutoMergeSubscription.Base.IUpsert autoMergeSubscriptionUpsertBLL,
						BusinessLogic.AutoMerge.Base.ISchedule scheduleBLL,
                        BusinessLogic.AutoMergeOptions.Base.IUpsert autoMergeOptionsUpsertBLL)
        {
            this.insertDAL = insertDAL;
            this.branchSelectBLL = branchSelectBLL;
            this.insertBranchBLL = insertBranchBLL;
            this.autoMergeSubscriptionUpsertBLL = autoMergeSubscriptionUpsertBLL;
            this.scheduleBLL = scheduleBLL;
            this.autoMergeOptionsUpsertBLL = autoMergeOptionsUpsertBLL;
        }
开发者ID:kwmcrell,项目名称:SourceManager,代码行数:14,代码来源:Insert.cs

示例15: MakeNew

        /// <summary>
        /// Creates a new Media
        /// </summary>
        /// <param name="Name">The name of the media</param>
        /// <param name="dct">The type of the media</param>
        /// <param name="u">The user creating the media</param>
        /// <param name="ParentId">The id of the folder under which the media is created</param>
        /// <returns></returns>
        public static Media MakeNew(string Name, MediaType dct, BusinessLogic.User u, int ParentId)
        {
            Guid newId = Guid.NewGuid();
            // Updated to match level from base node
            CMSNode n = new CMSNode(ParentId);
            int newLevel = n.Level;
            newLevel++;
            CMSNode.MakeNew(ParentId, _objectType, u.Id, newLevel, Name, newId);
            Media tmp = new Media(newId);
            tmp.CreateContent(dct);

            NewEventArgs e = new NewEventArgs();
            tmp.OnNew(e);

            return tmp;
        }
开发者ID:elrute,项目名称:Triphulcas,代码行数:24,代码来源:Media.cs


注:本文中的BusinessLogic类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。