Exemplo n.º 1
0
        /// <summary>
        /// 设置Session Name 用于显示
        /// 返回-1代表错误
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static String SetSessionName(String id, int stm)
        {
            IDataV context = MTSContext.Context(stm);

            return(context.GetName(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().NameStudent;
            //    case 2:
            //        var tea = from d in db.Teacher_table
            //                  where d.NumberTeacher == id
            //                  select d;
            //        return tea.FirstOrDefault().NameTeacher;
            //    case 1:
            //        var mana = from d in db.Arranger_table
            //                   where d.NumberArranger == id
            //                   select d;
            //        return mana.FirstOrDefault().NameArranger;

            //};
            //return "-1";
        }
Exemplo n.º 2
0
        /// <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;
        }