You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using HKLib.SQLHelper.Entity;
- using System;
- using System.Collections.Generic;
- using System.Text;
-
- namespace HKLib.SQLHelper
- {
- public class SqlLogic
- {
- public static PriceModel GetPrice()
- {
- return DbContext.Context.Queryable<PriceModel>().First();
- }
- public static PriceModel AddPrice(PriceModel input)
- {
- DbContext.Context.Deleteable<PriceModel>().Where(t => t.Id != 0).ExecuteCommand();
- return DbContext.Context.Insertable(input).ExecuteReturnEntity();
- }
- public static AdminModel AddAmin(string CardNo)
- {
- var d = new AdminModel
- {
- Name="管理员"+ CardNo,
- CardNo = CardNo
- };
- return DbContext.Context.Insertable(d).ExecuteReturnEntity();
- }
-
- public static AdminModel GetAdmin(string CardNo)
- {
- return DbContext.Context.Queryable<AdminModel>().First(t => t.CardNo == CardNo);
- }
- public static int GetAdmin()
- {
- return DbContext.Context.Queryable<AdminModel>().Select(t => t.Id).Count();
- }
- }
- }
|