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


C# SessionScopeWrapper类代码示例

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


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

示例1: GetPrimaryContactAddressStep

        public static void GetPrimaryContactAddressStep( ICustevent custevent, out System.String result)
        {
            // TODO: Complete business rule implementation
            using (ISession session = new SessionScopeWrapper())
            {
                string sql = "select top 1 a.address1  from sysdba.opportunity_contact oc left join sysdba.contact c on oc.contactid=c.contactid left join sysdba.address a on a.entityid=c.contactid where oc.isprimary='T' and a.isprimary='T' and opportunityid='"+custevent.Id.ToString()+"'";
                string add1 = session.CreateSQLQuery(sql).UniqueResult<string>();

                sql = "select top 1 a.address2  from sysdba.opportunity_contact oc left join sysdba.contact c on oc.contactid=c.contactid left join sysdba.address a on a.entityid=c.contactid where oc.isprimary='T' and a.isprimary='T' and opportunityid='"+custevent.Id.ToString()+"'";
                string add2 = session.CreateSQLQuery(sql).UniqueResult<string>();

                sql = "select top 1 a.city  from sysdba.opportunity_contact oc left join sysdba.contact c on oc.contactid=c.contactid left join sysdba.address a on a.entityid=c.contactid where oc.isprimary='T' and a.isprimary='T' and opportunityid='"+custevent.Id.ToString()+"'";
                string city = session.CreateSQLQuery(sql).UniqueResult<string>();

                sql = "select top 1 a.state  from sysdba.opportunity_contact oc left join sysdba.contact c on oc.contactid=c.contactid left join sysdba.address a on a.entityid=c.contactid where oc.isprimary='T' and a.isprimary='T' and opportunityid='"+custevent.Id.ToString()+"'";
                string state = session.CreateSQLQuery(sql).UniqueResult<string>();

                sql = "select top 1 a.postalcode  from sysdba.opportunity_contact oc left join sysdba.contact c on oc.contactid=c.contactid left join sysdba.address a on a.entityid=c.contactid where oc.isprimary='T' and a.isprimary='T' and opportunityid='"+custevent.Id.ToString()+"'";
                string pcode = session.CreateSQLQuery(sql).UniqueResult<string>();

                sql = "select top 1 a.country  from sysdba.opportunity_contact oc left join sysdba.contact c on oc.contactid=c.contactid left join sysdba.address a on a.entityid=c.contactid where oc.isprimary='T' and a.isprimary='T' and opportunityid='"+custevent.Id.ToString()+"'";
                string country = session.CreateSQLQuery(sql).UniqueResult<string>();

                string fswon = string.Concat(add1," ",add2," ",city,", ",state," ",pcode," ",country);
                result=fswon;
            }
        }
开发者ID:pebre77,项目名称:PrxS2,代码行数:27,代码来源:.4aef644b-2575-4265-a4d4-9e4aa92ed8d4.codesnippet.cs

示例2: RetrieveAuthenticationData

 public static AuthenticationData RetrieveAuthenticationData(String providerName)
 {
     using (var sess = new SessionScopeWrapper())
     {
         var prov = sess.CreateQuery("from OAuthProvider where ProviderName=?")
             .SetString(0, providerName)
             .List<IOAuthProvider>().FirstOrDefault();
         if (prov == null)
         {
             throw new Exception(String.Format("Unable to locate {0} provider in the configured OAuth providers", providerName));
         }
         var userToken = sess.CreateQuery("from UserOAuthToken where OAuthProvider.Id=? and User.Id=?")
             .SetString(0, prov.Id.ToString())
             .SetString(1, ApplicationContext.Current.Services.Get<IUserService>().UserId)
             .List<IUserOAuthToken>()
             .FirstOrDefault();
         if (userToken == null || userToken.AccessToken == null)
         {
             throw new Exception(String.Format("Unable to locate authorization token for current user under {0} provider", providerName));
         }
         if (userToken.ExpirationDate != null && userToken.ExpirationDate < DateTime.Now)
         {
             // TODO: refresh, if possible??  (Not applicable to either Twitter or Linked in, though)
             throw new Exception(String.Format("Authentication token for {0} provider has expired", providerName));
         }
         return new AuthenticationData
         {
             ConsumerKey = prov.ClientId,
             ConsumerSecret = prov.Secret,
             Token = userToken.AccessToken,
             TokenSecret = userToken.AccessTokenSecret,
             RefreshToken = userToken.RefreshToken
         };
     }
 }
开发者ID:Saleslogix,项目名称:SLXSocial,代码行数:35,代码来源:AuthenticationData.cs

示例3: ReloadSalesOrderStep

 public static void ReloadSalesOrderStep(IAddEditSalesOrder form, EventArgs args)
 {
     using (NHibernate.ISession session = new SessionScopeWrapper(false))
     {
         // forces NHibernate to reload the object
         session.Refresh(form.CurrentEntity);
     }
 }
开发者ID:ssommerfeldt,项目名称:TAC_MAT,代码行数:8,代码来源:.0bab9df5-62c2-43e1-8d35-ebfaf85d0115.codesnippet.cs

示例4: GetMemberPhoneStep

 public static void GetMemberPhoneStep( IMeetingTeam meetingteam, out System.String result)
 {
     // TODO: Complete business rule implementation
     using (ISession session = new SessionScopeWrapper())
     {
         string sql = "select phone from userinfo where userid='"+ meetingteam.UserID.ToString()+"'";
      		    result=session.CreateSQLQuery(sql).UniqueResult<string>();
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:9,代码来源:.f079173c-44c3-44ad-988a-162546948e85.codesnippet.cs

示例5: GetFirstServiceWonStep

 public static void GetFirstServiceWonStep(ICustfinancial custfinancial, out System.DateTime result)
 {
     // TODO: Complete business rule implementation
     using (ISession session = new SessionScopeWrapper()) {
         string sql = "select min(actualclose) from opportunity_product where opportunityid='" + custfinancial.Id.ToString() + "'";
         DateTime fswon = session.CreateSQLQuery(sql).UniqueResult<DateTime>();
         result = fswon;
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:9,代码来源:.ddc198ee-b1e1-461e-b386-34bdc17a7e81.codesnippet.cs

示例6: GetProductName

 public static void GetProductName( IOrderSummaryDetail ordersummarydetail, out System.String result)
 {
     using (ISession session = new SessionScopeWrapper())
     {
         string sql = "select description from product where productid='"+ordersummarydetail.Productid.ToString()+"'";
         string prodname = session.CreateSQLQuery(sql).UniqueResult<string>();
         result=prodname;
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:9,代码来源:.9fd59372-bc1e-4c20-a4c9-8019ea939fc1.codesnippet.cs

示例7: GetBusDevRepStep

 public static void GetBusDevRepStep( ICustfinancial custfinancial, out System.String result)
 {
     // TODO: Complete business rule implementation
     using (ISession session = new SessionScopeWrapper()){
     string sql = "select username from userinfo where userid=(select meetingmanager from accountconferon where accountid='"+custfinancial.Accountid+"')";
     string fswon = session.CreateSQLQuery(sql).UniqueResult<string>();
     result=fswon;
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:9,代码来源:.114241c6-5039-47d9-8cad-c47a77a5e6ee.codesnippet.cs

示例8: GetTotalAnticRepBudgetStep

 public static void GetTotalAnticRepBudgetStep( ICustfinancial custfinancial, out System.Decimal result)
 {
     // TODO: Complete business rule implementation
     using (ISession session = new SessionScopeWrapper()) {
         string sql = "select sum(revenue) from order_summary_detail where ordertype='Anticipated' and opportunityid='" + custfinancial.Id.ToString() + "'";
         decimal fswon = session.CreateSQLQuery(sql).UniqueResult<decimal>();
         result = fswon;
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:9,代码来源:.c4acbacc-2243-4250-ab17-b9babe70791e.codesnippet.cs

示例9: GetActualOrderRevStep

 public static void GetActualOrderRevStep( IOrderSummaryDetail ordersummarydetail, out System.Decimal result)
 {
     // TODO: Complete business rule implementation
     using (ISession session = new SessionScopeWrapper()) {
         string sql = "select revenue from order_summary_detail where ordertype='Actual' and order_summary_detailid='" + ordersummarydetail.Id.ToString() + "'";
         decimal fswon = session.CreateSQLQuery(sql).UniqueResult<decimal>();
         result = fswon;
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:9,代码来源:.e3f1c4a7-9019-4574-b4d9-ac01ee5bf85a.codesnippet.cs

示例10: GetWonServiceRevStep

 public static void GetWonServiceRevStep(ICustfinancial custfinancial, out System.Decimal result)
 {
     // TODO: Complete business rule implementation
     using (ISession session = new SessionScopeWrapper()) {
         string sql = "select sum(extendedprice) from opportunity_product where status='Execution' and opportunityid='" + custfinancial.Id.ToString() + "'";
         decimal fswon = session.CreateSQLQuery(sql).UniqueResult<decimal>();
         result = fswon;
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:9,代码来源:.018c5487-6a4d-4414-860a-b224726a4a3d.codesnippet.cs

示例11: Read

 public IEnumerable<IRecord> Read()
 {
     using (var sess = new SessionScopeWrapper())
     {
         var qry = sess.CreateQuery(_query);
         IList lst = qry.List();
         foreach (object o in lst)
             yield return new HqlRecordWrapper(o);
     }
 }
开发者ID:PmeyerSwiftpage,项目名称:NotificationEngine,代码行数:10,代码来源:HqlDataSource.cs

示例12: IsUserInTeam

 /// <summary>
 /// True if specified user is in specified team (or department).
 /// Note that this will return true whether the user is a direct member of the team,
 /// or manager of someone who is.
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="teamName"></param>
 /// <returns></returns>
 public static bool IsUserInTeam(String userId, String teamName)
 {
     using (var sess = new SessionScopeWrapper())
     {
         return 0 < sess.CreateQuery("select count(*) from OwnerRights sr where sr.User.Id=? and sr.Owner.OwnerDescription=?")
             .SetString(0, userId)
             .SetString(1, teamName)
             .UniqueResult<long>();
     }
 }
开发者ID:valterbastianelli,项目名称:OpenSlx,代码行数:18,代码来源:SecUtils.cs

示例13: TestFormatOwner

 public void TestFormatOwner()
 {
     String entityName = "Sage.SalesLogix.Entities.Contact";
     using (var sess = new SessionScopeWrapper())
     {
         SessionFactoryImpl sf = (SessionFactoryImpl)sess.SessionFactory;
         AbstractEntityPersister persister = (AbstractEntityPersister)(sf.GetEntityPersister(entityName));
         Assert.AreEqual("Owner.OwnerDescription", SimpleLookup.DecomposePath(sf, persister, "SECCODEID", "8"));
     }
 }
开发者ID:valterbastianelli,项目名称:OpenSlx,代码行数:10,代码来源:TestSimpleLookup.cs

示例14: GetServiceNameStep

 public static void GetServiceNameStep( ISalesOrderItem salesorderitem, out System.String result)
 {
     // TODO: Complete business rule implementation
     using (ISession session = new SessionScopeWrapper())
     {
         string sql = "select description from product where productid='"+salesorderitem.Product.Id+"'";
         string prodname = session.CreateSQLQuery(sql).UniqueResult<string>();
         result=prodname;
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:10,代码来源:.6e6a9255-69e0-47e3-9342-31da4705511d.codesnippet.cs

示例15: GetPrimaryContactPhoneStep2

 public static void GetPrimaryContactPhoneStep2( ICustevent custevent, out System.String result)
 {
     // TODO: Complete business rule implementation
     using (ISession session = new SessionScopeWrapper())
     {
         string sql = "select top 1 c.workphone from sysdba.opportunity_contact oc left join sysdba.contact c on oc.contactid=c.contactid where oc.isprimary='T' and opportunityid='"+custevent.Id.ToString()+"'";
         string fswon = session.CreateSQLQuery(sql).UniqueResult<string>();
         result=fswon;
     }
 }
开发者ID:pebre77,项目名称:PrxS2,代码行数:10,代码来源:.449b8e92-05c5-4cd9-ac83-a4ef9da646e4.codesnippet.cs


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