本文整理汇总了C#中SessionScopeWrapper.CreateSQLQuery方法的典型用法代码示例。如果您正苦于以下问题:C# SessionScopeWrapper.CreateSQLQuery方法的具体用法?C# SessionScopeWrapper.CreateSQLQuery怎么用?C# SessionScopeWrapper.CreateSQLQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionScopeWrapper
的用法示例。
在下文中一共展示了SessionScopeWrapper.CreateSQLQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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>();
}
}
示例2: 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;
}
}
示例3: 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;
}
}
示例4: 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;
}
}
示例5: 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;
}
}
示例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;
}
}
示例7: 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;
}
}
示例8: 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;
}
}
示例9: 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;
}
}
示例10: ValidateCommissionStep
public static void ValidateCommissionStep(IOpportunity opportunity, out Boolean result)
{
// TODO: Complete business rule implementation
result = false;
using (ISession session = new SessionScopeWrapper()) {
string strSQL = "select count(*) from salesorder where salescommission>0 and salescommission2>0 and accountid='"+opportunity.Account.Id.ToString()+"' and opportunityid='"+opportunity.Id.ToString()+"'";
int salesorder = session.CreateSQLQuery(strSQL).UniqueResult<int>();
if (salesorder > 0) {
result = true;
}
}
}
示例11: 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;
}
}
示例12: ValidateSalesOrderStep
public static void ValidateSalesOrderStep( IOpportunityProduct opportunityproduct, out Boolean result)
{
// TODO: Complete business rule implementation
result = false;
using (ISession session = new SessionScopeWrapper()) {
string strSQL = "select count(*) from salesorderdetail where productid ='"+opportunityproduct.Product.Id.ToString()+"' and salesorderid in (select salesorderid from salesorder where Actual = 'F' and Opportunityid='"+opportunityproduct.Opportunity.Id.ToString()+"')";
int salesorder = session.CreateSQLQuery(strSQL).UniqueResult<int>();
if (salesorder > 0) {
result = true;
}
}
}
示例13: GetInitialSalesRepStep
public static void GetInitialSalesRepStep( IOpportunity opportunity, out System.String result)
{
// TODO: Complete business rule implementation
string fswon = string.Empty;
try{
using (ISession session = new SessionScopeWrapper())
{
string sql = "select username from userinfo where userid='"+opportunity.Account.AccountConferon.InitialSalesRep.ToString()+"'";
fswon = session.CreateSQLQuery(sql).UniqueResult<string>();
}
}catch(Exception){}
result=fswon;
}
示例14: GetInitialSalesRepStep
public static void GetInitialSalesRepStep( ICustfinancial custfinancial, out System.String result)
{
string fswon = string.Empty;
try{
using (ISession session = new SessionScopeWrapper())
{
if (!string.IsNullOrEmpty(custfinancial.Account.AccountConferon.InitialSalesRep.ToString()) || custfinancial.Account.AccountConferon.InitialSalesRep.ToString()!=null)
{
string sql = "select username from userinfo where userid='"+custfinancial.Account.AccountConferon.InitialSalesRep.ToString()+"'";
fswon = session.CreateSQLQuery(sql).UniqueResult<string>();
}
}
}
catch(Exception){
}
result=fswon;
}
示例15: GetSalesOrdActRevStep
public static void GetSalesOrdActRevStep(ISalesOrder salesorder, out System.Double result)
{
// TODO: Complete business rule implementation
try{
using (ISession session = new SessionScopeWrapper()) {
double fswon=0;
if (salesorder!=null){
if (!string.IsNullOrEmpty(salesorder.Id.ToString())){
string sql = "select top 1 ordertotal from salesorder where Actual='T' and anticipatedid='" + salesorder.Id.ToString() + "'";
fswon = session.CreateSQLQuery(sql).UniqueResult<double>();
}
}
if (!string.IsNullOrEmpty(fswon.ToString())){
result = fswon;
} else {
result = 0;
}
}
}
catch(Exception) { result=0;}
}