public static List <Vacation> GetALL(string condition)
        {
            List <Vacation> list = new List <Vacation>();
            string          sql  = string.Format("select * from T_Vacation where condition='{0}'", condition);

            ds = DBAcess.GetDataSet(sql);
            if (ds == null)
            {
                return(null);
            }
            else
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    a             = new Vacation();
                    a.number      = dr["Number"].ToString();
                    a.id          = dr["ID"].ToString();
                    a.name        = dr["name"].ToString();
                    a.type        = dr["type"].ToString();
                    a.reason      = dr["reason"].ToString();
                    a.daystart    = dr["daystart"].ToString();
                    a.dayover     = dr["dayover"].ToString();
                    a.applytime   = dr["applytime"].ToString();
                    a.agreepeople = dr["applytime"].ToString();
                    a.condition   = dr["condition"].ToString();
                    list.Add(a);
                }
                return(list);
            }
        }
示例#2
0
        public static IList <Score> getAll()
        {
            List <Score> list = new List <Score>();
            string       sql  = "select sid,stuid,T_Score.cid,cname,score from T_Score,T_Course where T_Score.cid=T_Course.cid";

            ds = DBAcess.GetDataSet(sql);
            if (ds == null)
            {
                return(null);
            }
            else
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    sc        = new Score();
                    sc.Sid    = int.Parse(dr["sid"].ToString());
                    sc.Stuid  = dr["stuid"].ToString();
                    sc.Cid    = int.Parse(dr["cid"].ToString());
                    sc.Cname  = dr["cname"].ToString();
                    sc.Scores = int.Parse(dr["score"].ToString());
                    list.Add(sc);
                }
                return(list);
            }
        }
        public static List <Student> GetALL()
        {
            List <Student> list = new List <Student>();

            sql = "select * from T_Student";
            ds  = DBAcess.GetDataSet(sql);
            if (ds == null)
            {
                return(null);
            }
            else
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    a           = new Student();
                    a.Id        = dr["ID"].ToString();
                    a.Name      = dr["name"].ToString();
                    a.Sex       = dr["sex"].ToString();
                    a.Political = dr["political"].ToString();
                    a.Grade     = dr["grade"].ToString();
                    a.class1    = dr["class"].ToString();
                    a.Address   = dr["address"].ToString();
                    a.Phone     = dr["phone"].ToString();
                    a.Main      = true;
                    list.Add(a);
                }
                return(list);
            }
        }
示例#4
0
        public static List <Student> GetALL()
        {
            List <Student> list = new List <Student>();

            sql = "select * from T_Student";
            ds  = DBAcess.GetDataSet(sql);
            if (ds == null)
            {
                return(null);
            }
            else
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    a          = new Student();
                    a.Id       = dr["id"].ToString();
                    a.Name     = dr["Name"].ToString();
                    a.Classes  = dr["Classes"].ToString();
                    a.Major    = dr["Major"].ToString();
                    a.College  = dr["College"].ToString();
                    a.Grade    = dr["grade"];
                    a.Sex      = dr["Sex"].ToString();
                    a.Address  = dr["Address"].ToString();
                    a.Pincodes = dr["pincodes"].ToString();
                    a.Imgurl   = dr["Imgurl"].ToString();
                    a.Main     = true;
                    list.Add(a);
                }
                return(list);
            }
        }
示例#5
0
        public static IList <SystemLog> Show()
        {
            List <SystemLog> list = new List <SystemLog>();
            string           sql  = "select LogID,Operator.DateTime,Activity,Status,IPAdd,DetailInfo from T_SystemLog";
            DataSet          ds   = DBAcess.GetDataSet(sql);

            if (ds == null)
            {
                return(null);
            }
            else
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    SystemLog sl = new SystemLog();
                    sl.LogID      = (dr["LogID"].ToString());
                    sl.Operator   = (dr["Operator"].ToString());
                    sl.DateTimes  = (dr["DateTime"].ToString());
                    sl.Activity   = (dr["Activity"].ToString());
                    sl.Status     = (dr["Status"].ToString());
                    sl.IPAdd      = (dr["IPAdd"].ToString());
                    sl.DetailInfo = (dr["DetailInfo"].ToString());
                    list.Add(sl);
                }
                return(list);
            }
        }
示例#6
0
 public static bool checkAdmin(Admin a)
 {
     sql = string.Format("select * from T_Admin where ID='{0}' and Password='******' and Privilege='{2}'", a.Id, a.Password, a.Privilege);
     ds  = DBAcess.GetDataSet(sql);
     if (ds != null)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#7
0
        public static Dictionary <int, String> getCourse()
        {
            int    cid;
            String cname;
            Dictionary <int, String> dic = new Dictionary <int, String>();
            string sql = string.Format("select * from T_Course");

            ds = DBAcess.GetDataSet(sql);
            if (ds == null)
            {
                return(null);
            }
            else
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    cid   = int.Parse(dr["cid"].ToString());
                    cname = dr["cname"].ToString();
                    dic.Add(cid, cname);
                }
                return(dic);
            }
        }
示例#8
0
        public static IList <Admin> adminList()
        {
            List <Admin> list = new List <Admin>();

            sql = "select * from T_Admin";
            ds  = DBAcess.GetDataSet(sql);
            if (ds == null)
            {
                return(null);
            }
            else
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    sc           = new Admin();
                    sc.Id        = dr["Id"].ToString();
                    sc.Password  = dr["Password"].ToString();
                    sc.Privilege = int.Parse(dr["Privilege"].ToString());
                    list.Add(sc);
                }
                return(list);
            }
        }