Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Dianda.Model.DOC_transport_To> DataTableToList(DataTable dt)
        {
            List <Dianda.Model.DOC_transport_To> modelList = new List <Dianda.Model.DOC_transport_To>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Dianda.Model.DOC_transport_To model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new Dianda.Model.DOC_transport_To();
                    model.ID       = dt.Rows[n]["ID"].ToString();
                    model.FROMUSER = dt.Rows[n]["FROMUSER"].ToString();
                    model.TOUSER   = dt.Rows[n]["TOUSER"].ToString();
                    model.TITLES   = dt.Rows[n]["TITLES"].ToString();
                    model.FILEPATH = dt.Rows[n]["FILEPATH"].ToString();
                    if (dt.Rows[n]["DATETIME"].ToString() != "")
                    {
                        model.DATETIME = DateTime.Parse(dt.Rows[n]["DATETIME"].ToString());
                    }
                    if (dt.Rows[n]["DELFLAG"].ToString() != "")
                    {
                        model.DELFLAG = int.Parse(dt.Rows[n]["DELFLAG"].ToString());
                    }
                    if (dt.Rows[n]["ISREAD"].ToString() != "")
                    {
                        model.ISREAD = int.Parse(dt.Rows[n]["ISREAD"].ToString());
                    }
                    if (dt.Rows[n]["READTIME"].ToString() != "")
                    {
                        model.READTIME = DateTime.Parse(dt.Rows[n]["READTIME"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Dianda.Model.DOC_transport_To model)
 {
     dal.Update(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Dianda.Model.DOC_transport_To model)
 {
     dal.Add(model);
 }