/// <summary> /// 设置Session ID 用于显示 /// 返回-1代表错误 /// </summary> /// <param name="id"></param> /// <returns></returns> public static int SetSessionID(String id, int stm) { IDataV context = MTSContext.Context(stm); return(context.GetID(id)); //DBWebCCEntities db = new DBWebCCEntities(); //switch (stm) //{ // case 3: // var stu = from d in db.Student_table // where d.NumberStudent == id // select d; // return stu.FirstOrDefault().IDStudent; // case 2: // var tea = from d in db.Teacher_table // where d.NumberTeacher == id // select d; // return tea.FirstOrDefault().IDTeacher; // case 1: // var mana = from d in db.Arranger_table // where d.NumberArranger == id // select d; // return mana.FirstOrDefault().IDArranger; //}; //return -1; }
/// <summary> /// 设置用户Session信息 /// </summary> /// <param name="login"></param> /// <param name="i"></param> public void SetSession(String login, int i) { IDataV context = MTSContext.Context(i); //login 指的是编号 SessionInfo_Num = login; SessionInfo_Name = context.GetName(login); SessionInfo_ID = context.GetID(login); SessionInfo_Authority = i; }