using System; using System.Collections.Generic; using System.Linq; using System.Text; using EAS.Data; using EAS.Services; using SOH.Entities; using EAS.Data.Access; namespace SOH.BLL { [ServiceObject("基本业务功能")] [ServiceBind(typeof(IBasic))] public class BasicBll : IBasic { public int GetMax(string tablename, int needcount) { //throw new NotImplementedException(); using (DbEntities db = new DbEntities()) { ParameterCollection pc = new ParameterCollection(); pc.Add("tablename", tablename); pc.Add("needcount", needcount); return (int)db.DataAccessor.Query("exec GetIdentity @tablename=?,@needcount=?", pc); } } /// /// 获取条码号 /// /// 分店代码 /// 团体个人1团体0个人 /// 需要数量 /// public int gettmh(int fddm, int grortt, int needcount) { string key = "tm_" + fddm.ToString(); int val = GetMax(key, needcount); string vals = (grortt == 1 ? "1" : "0") + fddm.ToString("00") + val.ToString("0000000"); //if(fddm==2) //{ // vals = (grortt == 1 ? "1" : "2") + fddm.ToString("00") + val.ToString("0000000"); //} return int.Parse(vals); } /// /// 获取会员号 /// /// 分店代码 /// 需要数量 /// public int gethyh(int fddm, int needcount) { string key = "hy_" + fddm.ToString(); int val = GetMax(key, needcount); string vals = fddm.ToString("000") + val.ToString("0000000"); return int.Parse(vals); } public List GetAlljydl() { using (DbEntities db = new DbEntities()) { return db.list_jydls.OrderBy(l=>l.lisdl).ToList(); //list = list.OrderBy(l => l.time) //return null; } } } }