Interface notation Definition

Source: Internet
Author: User

Methods for getting an interface

public static T getprovider<t> ()
{
using (var kernal = new Standardkernel (new Businessbinding ()))
{
var Provider = Kernal. Get<t> ();
return provider;
}
}

Binding interface

public override void Load ()
{

Bind<ilpprovider> (). To<lpprovider> ();

}

Interface Idal notation

public interface Ilpprovider
{

DataSet getlpuser (String begindate,string enddate,string ClientID, string UserID, string keywords, int status, int color, int index, int page, ref int tatal, String teamid, string seachuserid, int serchtype,int sortname,int sorttype, String Sea Rchclientid);

}

Write call interface acquisition and interface method in the business,

var Provider = common.getprovider<ilpprovider> ();

DataSet data = provider. Getlpuser (Begindate,enddate,clientid, UserID, keywords, (int) status, color, index, page, ref tatal, Teamid, Seachuserid, Serchtype, Sortname, SortType, Searchclientid);

Data Interface dal notation

Public DataSet Getlpuser (string begindate,string enddate,string ClientID, string UserID, string keywords, int status, int color, int index, int page, ref int total, String teamid, String Seachuserid,
int serchtype, int sortname, int sorttype, string searchclientid)
{
using (SqlConnection conn = new SqlConnection (ConnectionString))
{
SqlCommand cmd = new SqlCommand ("Lp_getlplist", conn);
Cmd.commandtype = System.Data.CommandType.StoredProcedure;
String sortname = "";
Switch (sortname)
{

/**1. Number of papers to be prepared
* 2. Number of Registrations
* 3. Number of contracts
* 4. Number of payments
* 5. Total paid
* 6. Join time
* 7. Cumulative Commission
* **/
Case 1:
Sortname = "Q.reportnum";
Break
Case 2:
Sortname = "L.registernum";
Break
Case 3:
Sortname = "L.signnum";
Break
Case 4:
Sortname = "L.expensenum";
Break
Case 5:
Sortname = "L.expenseamount";
Break
Case 6:
Sortname = "L.audittime";
Break
Case 7:
Sortname = "L.haveamount";
Break
Default
Sortname = "L.registernum";
Break
}
Cmd. Parameters.Add ("@SortName", SqlDbType.VarChar, 50). Value = Sortname;
Cmd. Parameters.Add ("@SortType", SqlDbType.Int). Value = SortType;
Cmd. Parameters.Add ("@FilterUserID", SqlDbType.VarChar, 64). Value = Seachuserid;
Cmd. Parameters.Add ("@SerchType", SqlDbType.Int). Value = Serchtype;
Cmd. Parameters.Add ("@ClientID", SqlDbType.VarChar, 64). Value = ClientID;
Cmd. Parameters.Add ("@UserID", sqldbtype.varchar,64). Value=userid;
Cmd. Parameters.Add ("@KeyWords", sqldbtype.varchar,100). Value=keywords;
Cmd. Parameters.Add ("@Status", SqlDbType.Int). Value=status;
Cmd. Parameters.Add ("@Color", SqlDbType.Int). Value=color;
Cmd. Parameters.Add ("@Index", SqlDbType.Int). Value=index;
Cmd. Parameters.Add ("@Page", SqlDbType.Int). Value=page;
Cmd. Parameters.Add ("@TeamID", sqldbtype.varchar,64). Value=teamid;
Cmd. Parameters.Add ("@SearchClientID", SqlDbType.VarChar, 64). Value = Searchclientid;
Cmd. Parameters.Add ("@BeginDate", sqldbtype.varchar,32). Value = begindate;
Cmd. Parameters.Add ("@EndDate", SqlDbType.VarChar, 32). Value = endDate;
Cmd. Parameters.addwithvalue ("@Total", total). Direction = Parameterdirection.inputoutput;
Conn. Open ();

DataSet data = new DataSet ();

FillDataSet (data, cmd, "LP");
Total = Int. Parse (cmd. parameters["@Total"]. Value.tostring ());
return data;
}
}

Interface notation Definition

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.