コード例 #1
0
ファイル: Group.cs プロジェクト: luutrangminh/SPM_URD
        public static List <propGroup> Get(int professorId)
        {
            var listGroup = new List <propGroup>();
            var data      = DataAccess.Group.Get(professorId);

            if (data == null)
            {
                return(null);
            }
            while (data.Read())
            {
                propGroup group = new propGroup();
                group.id           = int.Parse(data["Id"].ToString());
                group.projectId    = int.Parse(data["ProjectId"].ToString());
                group.code         = data["GroupCode"].ToString();
                group.name         = data["GroupName"].ToString();
                group.createAt     = DateTime.Parse(data["CreatedAt"].ToString());
                group.createdBy    = int.Parse(data["CreatedBy"].ToString());
                group.createdByStr = data["CreatedByStr"].ToString();
                group.AssignBy     = int.Parse(data["AssignBy"].ToString());
                listGroup.Add(group);
            }
            data.Close();
            return(listGroup);
        }
コード例 #2
0
ファイル: Group.cs プロジェクト: luutrangminh/SPM_URD
        public static propGroup GetById(int id)
        {
            var group = new propGroup();
            var data  = DataAccess.Group.GetById(id);

            if (data == null)
            {
                return(null);
            }
            while (data.Read())
            {
                group.id           = int.Parse(data["Id"].ToString());
                group.projectId    = int.Parse(data["ProjectId"].ToString());
                group.code         = data["GroupCode"].ToString();
                group.name         = data["GroupName"].ToString();
                group.createAt     = DateTime.Parse(data["CreatedAt"].ToString());
                group.createdBy    = int.Parse(data["CreatedBy"].ToString());
                group.createdByStr = data["CreatedByStr"].ToString();
                group.AssignBy     = int.Parse(data["AssignBy"].ToString());
            }
            data.Close();
            return(group);
        }