Beispiel #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <lgk.Model.tb_Security> GetModelList(DataTable dt)
        {
            List <lgk.Model.tb_Security> myList = new List <lgk.Model.tb_Security>();

            lgk.Model.tb_Security model;

            if (dt.Rows.Count == 0)
            {
                return(myList);
            }

            foreach (DataRow row in dt.Rows)
            {
                model = new lgk.Model.tb_Security();

                if (row["SecurityID"] != null && row["SecurityID"].ToString() != "")
                {
                    model.SecurityID = int.Parse(row["SecurityID"].ToString());
                }
                if (row["Question"] != null && row["Question"].ToString() != "")
                {
                    model.Question = row["Question"].ToString();
                }
                if (row["AddUserID"] != null && row["AddUserID"].ToString() != "")
                {
                    model.AddUserID = int.Parse(row["AddUserID"].ToString());
                }
                if (row["Status"] != null && row["Status"].ToString() != "")
                {
                    model.Status = int.Parse(row["Status"].ToString());
                }

                myList.Add(model);
            }

            return(myList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(lgk.Model.tb_Security model)
 {
     return(dal.Update(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(lgk.Model.tb_Security model)
 {
     return(dal.Add(model));
 }