• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# BusinessLogic类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: MakeNew

		public static void MakeNew(BusinessLogic.User User, cms.businesslogic.CMSNode Node, char PermissionKey) 
		{
            IParameter[] parameters = new IParameter[] { SqlHelper.CreateParameter("@userId", User.Id),
                                                         SqlHelper.CreateParameter("@nodeId", Node.Id),
                                                         SqlHelper.CreateParameter("@permission", PermissionKey.ToString()) };

            // Method is synchronized so exists remains consistent (avoiding race condition)
            bool exists = SqlHelper.ExecuteScalar<int>("SELECT COUNT(userId) FROM umbracoUser2nodePermission WHERE userId = @userId AND nodeId = @nodeId AND permission = @permission",
                                                       parameters) > 0;
            if (!exists) {
                SqlHelper.ExecuteNonQuery("INSERT INTO umbracoUser2nodePermission (userId, nodeId, permission) VALUES (@userId, @nodeId, @permission)",
                                          parameters);
                // clear user cache to ensure permissions are re-loaded
                User.GetUser(User.Id).FlushFromCache();
            }
		}
开发者ID:Jeavon,项目名称:Umbraco-CMS,代码行数:16,代码来源:Permission.cs


示例17: MakeNew

        public static Media MakeNew(string Name, MediaType dct, BusinessLogic.User u, int ParentId)
        {
            var e = new NewEventArgs();
            OnNewing(e);
            if (e.Cancel)
            {
                return null;
            }

            var media = ApplicationContext.Current.Services.MediaService.CreateMediaWithIdentity(Name, ParentId, dct.Alias, u.Id);
            //The media object will only have the 'WasCancelled' flag set to 'True' if the 'Creating' event has been cancelled
            if (((Entity)media).WasCancelled)
                return null;

            var tmp = new Media(media);

            tmp.OnNew(e);

            return tmp;
        }
开发者ID:phaniarveti,项目名称:Experiments,代码行数:20,代码来源:Media.cs


示例18: ControladorTCP_SegmentoRecibido

        void ControladorTCP_SegmentoRecibido(object sender, BusinessLogic.Datos.TCPSegmentRecibido e)
        {
            PacketSOA paquete = new PacketSOA();
            paquete.IpOrigen = e.PacketRecibido.IpOrigen;
            paquete.IpDestino = e.PacketRecibido.IpDestino;
            TCPSegmentSOA segment = new TCPSegmentSOA(e.SegmentoTCPRecibido.SourcePort,
                e.SegmentoTCPRecibido.DestinationPort,
                paquete,
                e.SegmentoTCPRecibido.SYN_Flag,
                e.SegmentoTCPRecibido.ACK_Flag,
                e.SegmentoTCPRecibido.SEQ_Number,
                e.SegmentoTCPRecibido.ACK_Number,e.HoraDeTransmision,
                false,
                e.SegmentoTCPRecibido.DataLength,
                e.SegmentoTCPRecibido.FinFlag);
            foreach (IVisualizacion vist in Vistas)
            {
                vist.EnviarInformacionSegmentoRecibido(_pc.Id, segment);

            }
        }
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:21,代码来源:ModeloSnifferPC.cs


示例19: CapaDatos_PaqueteDesEncapsulado

        void CapaDatos_PaqueteDesEncapsulado(object sender, BusinessLogic.Datos.PaqueteDesencapsuladoEventArgs e)
        {
            FrameSOA frameSOA = new FrameSOA();
            frameSOA.MACAddressOrigen = e.Frame.MACAddressOrigen;
            frameSOA.MACAddressDestino = e.Frame.MACAddressDestino;
            Packet paquete = e.Frame.Informacion as Packet;
            PacketSOA packSOA = new PacketSOA();
            packSOA.IpOrigen = paquete.IpOrigen;
            packSOA.IpDestino = paquete.IpDestino;
            packSOA.Datos = paquete.Datos.ToString();
            EncapsulacionSOA encapsulacion = new EncapsulacionSOA();
            encapsulacion.Fecha = e.HoraDeRecepcion;
            encapsulacion.Frame = frameSOA;
            encapsulacion.Paquete = packSOA;
            encapsulacion.IdEquipo = _router.Id;
            encapsulacion.EsEncapsulacion = false;
            foreach (IVisualizacion vist in Vistas)
            {
                vist.EnviarInformacionEncapsulacionRouter(encapsulacion);

            }
        }
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:22,代码来源:ModeloSnifferRouter.cs


示例20: Index

        //[HttpPost]
        public ActionResult Index(HomeModel model)
        {
            //var model = new HomeModel(); // n tier
            // try catch
            //model.WelcomeTextTag = "span";

            try
            {
                BusinessLogic l = new BusinessLogic();
                l.BusinesLogicOperation();
                return null;
            }
            catch (ProjectException e)
            {
                // rekurencja e.InnerException.
            }
            finally
            {

            }

            return View(model);
        }
开发者ID:sparrow41,项目名称:training,代码行数:24,代码来源:HomeController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BusinessObjectCollection类代码示例发布时间:2022-05-24
下一篇:
C# BusinessLayer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap