using System;
using System.Collections.Generic;



namespace StuMgmLib.MyNameSpace
{

    public enum ErrCode
    {
        Success,
        FailSerial,
        FailDeserial,
        FailConnect,
        FailSend,
        FailReceive,
        ErrData,
    }
    public enum ClientFunc
    {
        VerifyLogin = 1,
        GetCourseInfo = 2,
        GetSelfUserCourseInfo = 3,
        SUpdateCourse = 4,
        TUpdateCourse = 5,
        GetSomeoneUserCInfo = 6,
    }
 
    public enum Lvl
    {
        NotFound = -1,
        Error = -2,
        Admin = 1,
        Teacher = 2,
        Student = 3,
    }
  
    [Serializable]
    public class ClientRequest
    {
        public ClientFunc Func;
        public object Object;
        public ClientRequest(ClientFunc func, object obj)
        {
            Func = func;
            Object = obj;
        }
    }

    [Serializable]
    public class UserInfoLogin
    {
        public short Account;
        public string Password;

        public UserInfoLogin(short account, string password) // Changed
        {
            Account = account;
            Password = password;
        }
    }
    [Serializable]
    public class UserCourseInfoReq
    {
        public short Job_Id;
        public int Token;
    }

    [Serializable]
    public class UserCourseInfoOper // T represents teacher, S ->student
    {
        public short Job_Id;
        public int Token;
        public string Status; // 课程状态
    }

    [Serializable]
    public enum CourseStatusEnum
    {
        NoStart=0,
        Begin,
        WaitCheckig,
        CheckigSuccess,
        CheckigFail,
        //
    }


    [Serializable]
    public class ServerResponse
    {
        public bool Final;//操作是否成功
        public string ErrMessage;//错误信息
        public object Object;
        public ServerResponse(object obj)
        {
            Object = obj;
        }
    }

    [Serializable]
    public class LoginResponse
    {
        public int Token;
        public Lvl Level;
    }

    [Serializable]
    public class CourseInfo
    {
        public short Id;
        public short Pid;
        public int Time;
        public string Name;
        public string Content;
    }

    [Serializable]
    public class UserCourseInfo
    {
        public short JobId;//工号
        public string Name;//姓名
        public string Status; // 课程状态
        public string Details;//信息描述
    }
 
    public class UserCourseDetail
    {
        public short Id;
        public string Name;
        public string Content;
        public int Time;
        public int Status;
        public List<UserCourseDetail> Children;
    }


}

