Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Maticsoft.Model.t_LoginMarks> DataTableToList(DataTable dt)
        {
            List<Maticsoft.Model.t_LoginMarks> modelList = new List<Maticsoft.Model.t_LoginMarks>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Maticsoft.Model.t_LoginMarks model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.t_LoginMarks();
                                                    if(dt.Rows[n]["markId"].ToString()!="")
                {
                    model.markId=int.Parse(dt.Rows[n]["markId"].ToString());
                }
                                                                                                                                if(dt.Rows[n]["userId"].ToString()!="")
                {
                    model.userId=int.Parse(dt.Rows[n]["userId"].ToString());
                }
                                                                                                                                if(dt.Rows[n]["loginTime"].ToString()!="")
                {
                    model.loginTime=DateTime.Parse(dt.Rows[n]["loginTime"].ToString());
                }
                                                                                                                                                model.userName= dt.Rows[n]["userName"].ToString();

                    modelList.Add(model);
                }
            }
            return modelList;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Maticsoft.Model.t_LoginMarks> DataTableToList(DataTable dt)
        {
            List <Maticsoft.Model.t_LoginMarks> modelList = new List <Maticsoft.Model.t_LoginMarks>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Maticsoft.Model.t_LoginMarks model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.t_LoginMarks();
                    if (dt.Rows[n]["markId"].ToString() != "")
                    {
                        model.markId = int.Parse(dt.Rows[n]["markId"].ToString());
                    }
                    if (dt.Rows[n]["userId"].ToString() != "")
                    {
                        model.userId = int.Parse(dt.Rows[n]["userId"].ToString());
                    }
                    if (dt.Rows[n]["loginTime"].ToString() != "")
                    {
                        model.loginTime = DateTime.Parse(dt.Rows[n]["loginTime"].ToString());
                    }
                    model.userName = dt.Rows[n]["userName"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.t_LoginMarks model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(Maticsoft.Model.t_LoginMarks model)
 {
     dal.Add(model);
 }