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

            if (rowsCount > 0)
            {
                university.Model.CCOM.Examination_CEE_score model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Examination_CEE_score();
                    if (dt.Rows[n]["CEE_id"].ToString() != "")
                    {
                        model.CEE_id = int.Parse(dt.Rows[n]["CEE_id"].ToString());
                    }
                    if (dt.Rows[n]["CEE_Chinese_score"].ToString() != "")
                    {
                        model.CEE_Chinese_score = decimal.Parse(dt.Rows[n]["CEE_Chinese_score"].ToString());
                    }
                    if (dt.Rows[n]["CEE_Math_score"].ToString() != "")
                    {
                        model.CEE_Math_score = decimal.Parse(dt.Rows[n]["CEE_Math_score"].ToString());
                    }
                    if (dt.Rows[n]["CEE_English_score"].ToString() != "")
                    {
                        model.CEE_English_score = decimal.Parse(dt.Rows[n]["CEE_English_score"].ToString());
                    }
                    if (dt.Rows[n]["CEE_comprehensive_score"].ToString() != "")
                    {
                        model.CEE_comprehensive_score = decimal.Parse(dt.Rows[n]["CEE_comprehensive_score"].ToString());
                    }
                    if (dt.Rows[n]["CEE_extra_score"].ToString() != "")
                    {
                        model.CEE_extra_score = decimal.Parse(dt.Rows[n]["CEE_extra_score"].ToString());
                    }
                    if (dt.Rows[n]["CEE_score"].ToString() != "")
                    {
                        model.CEE_score = decimal.Parse(dt.Rows[n]["CEE_score"].ToString());
                    }
                    if (dt.Rows[n]["CEE_type"].ToString() != "")
                    {
                        model.CEE_type = int.Parse(dt.Rows[n]["CEE_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]["CEE_status"].ToString() != "")
                    {
                        if ((dt.Rows[n]["CEE_status"].ToString() == "1") || (dt.Rows[n]["CEE_status"].ToString().ToLower() == "true"))
                        {
                            model.CEE_status = true;
                        }
                        else
                        {
                            model.CEE_status = false;
                        }
                    }


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