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

            if (rowsCount > 0)
            {
                university.Model.CCOM.Fractional_line model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.Fractional_line();
                    if (dt.Rows[n]["Fl_id"].ToString() != "")
                    {
                        model.Fl_id = int.Parse(dt.Rows[n]["Fl_id"].ToString());
                    }
                    if (dt.Rows[n]["Fl_Province"].ToString() != "")
                    {
                        model.Fl_Province = int.Parse(dt.Rows[n]["Fl_Province"].ToString());
                    }
                    if (dt.Rows[n]["WenKeYiBen"].ToString() != "")
                    {
                        model.WenKeYiBen = decimal.Parse(dt.Rows[n]["WenKeYiBen"].ToString());
                    }
                    if (dt.Rows[n]["LiKeYiBen"].ToString() != "")
                    {
                        model.LiKeYiBen = decimal.Parse(dt.Rows[n]["LiKeYiBen"].ToString());
                    }
                    if (dt.Rows[n]["WenKeErBen"].ToString() != "")
                    {
                        model.WenKeErBen = decimal.Parse(dt.Rows[n]["WenKeErBen"].ToString());
                    }
                    if (dt.Rows[n]["LiKeErBen"].ToString() != "")
                    {
                        model.LiKeErBen = decimal.Parse(dt.Rows[n]["LiKeErBen"].ToString());
                    }
                    if (dt.Rows[n]["WenKeSanBen"].ToString() != "")
                    {
                        model.WenKeSanBen = decimal.Parse(dt.Rows[n]["WenKeSanBen"].ToString());
                    }
                    if (dt.Rows[n]["LiKeSanBen"].ToString() != "")
                    {
                        model.LiKeSanBen = decimal.Parse(dt.Rows[n]["LiKeSanBen"].ToString());
                    }
                    if (dt.Rows[n]["WenKeYiShuXian"].ToString() != "")
                    {
                        model.WenKeYiShuXian = decimal.Parse(dt.Rows[n]["WenKeYiShuXian"].ToString());
                    }
                    if (dt.Rows[n]["LiKeYiShuXian"].ToString() != "")
                    {
                        model.LiKeYiShuXian = decimal.Parse(dt.Rows[n]["LiKeYiShuXian"].ToString());
                    }
                    if (dt.Rows[n]["WenKeZongFen"].ToString() != "")
                    {
                        model.WenKeZongFen = decimal.Parse(dt.Rows[n]["WenKeZongFen"].ToString());
                    }
                    if (dt.Rows[n]["LiKeZongFen"].ToString() != "")
                    {
                        model.LiKeZongFen = decimal.Parse(dt.Rows[n]["LiKeZongFen"].ToString());
                    }
                    if (dt.Rows[n]["Period_id"].ToString() != "")
                    {
                        model.Period_id = int.Parse(dt.Rows[n]["Period_id"].ToString());
                    }
                    if (dt.Rows[n]["Fl_addtime"].ToString() != "")
                    {
                        model.Fl_addtime = DateTime.Parse(dt.Rows[n]["Fl_addtime"].ToString());
                    }


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