Exemplo n.º 1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(university.Model.CCOM.Transcript model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(university.Model.CCOM.Transcript model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <university.Model.CCOM.Transcript> DataTableToList(DataTable dt)
        {
            List <university.Model.CCOM.Transcript> modelList = new List <university.Model.CCOM.Transcript>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                university.Model.CCOM.Transcript model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Transcript();
                    if (dt.Rows[n]["Transcript_id"].ToString() != "")
                    {
                        model.Transcript_id = int.Parse(dt.Rows[n]["Transcript_id"].ToString());
                    }
                    if (dt.Rows[n]["Transcript_AEE_score"].ToString() != "")
                    {
                        model.Transcript_AEE_score = decimal.Parse(dt.Rows[n]["Transcript_AEE_score"].ToString());
                    }
                    if (dt.Rows[n]["Transcript_AEE_sequence"].ToString() != "")
                    {
                        model.Transcript_AEE_sequence = decimal.Parse(dt.Rows[n]["Transcript_AEE_sequence"].ToString());
                    }
                    if (dt.Rows[n]["Transcript_AEE_ranking"].ToString() != "")
                    {
                        model.Transcript_AEE_ranking = int.Parse(dt.Rows[n]["Transcript_AEE_ranking"].ToString());
                    }
                    if (dt.Rows[n]["Transcript_CEE_score"].ToString() != "")
                    {
                        model.Transcript_CEE_score = decimal.Parse(dt.Rows[n]["Transcript_CEE_score"].ToString());
                    }
                    if (dt.Rows[n]["Transcript_CEE_convert_score"].ToString() != "")
                    {
                        model.Transcript_CEE_convert_score = decimal.Parse(dt.Rows[n]["Transcript_CEE_convert_score"].ToString());
                    }
                    if (dt.Rows[n]["Transcript_passline"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Transcript_passline"].ToString() == "1") || (dt.Rows[n]["Transcript_passline"].ToString().ToLower() == "true"))
                        {
                            model.Transcript_passline = true;
                        }
                        else
                        {
                            model.Transcript_passline = false;
                        }
                    }
                    if (dt.Rows[n]["Transcript_type"].ToString() != "")
                    {
                        model.Transcript_type = int.Parse(dt.Rows[n]["Transcript_type"].ToString());
                    }
                    if (dt.Rows[n]["Period_id"].ToString() != "")
                    {
                        model.Period_id = int.Parse(dt.Rows[n]["Period_id"].ToString());
                    }
                    if (dt.Rows[n]["User_id"].ToString() != "")
                    {
                        model.User_id = long.Parse(dt.Rows[n]["User_id"].ToString());
                    }
                    if (dt.Rows[n]["Transcript_score"].ToString() != "")
                    {
                        model.Transcript_score = decimal.Parse(dt.Rows[n]["Transcript_score"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }