Beispiel #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <CSLG.CTalk.Model.DICT_userState> DataTableToList(DataTable dt)
        {
            List <CSLG.CTalk.Model.DICT_userState> modelList = new List <CSLG.CTalk.Model.DICT_userState>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                CSLG.CTalk.Model.DICT_userState model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new CSLG.CTalk.Model.DICT_userState();
                    if (dt.Rows[n]["userStateID"] != null && dt.Rows[n]["userStateID"].ToString() != "")
                    {
                        model.userStateID = int.Parse(dt.Rows[n]["userStateID"].ToString());
                    }
                    if (dt.Rows[n]["userStateName"] != null && dt.Rows[n]["userStateName"].ToString() != "")
                    {
                        model.userStateName = dt.Rows[n]["userStateName"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(CSLG.CTalk.Model.DICT_userState model)
 {
     return(dal.Update(model));
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(CSLG.CTalk.Model.DICT_userState model)
 {
     return(dal.Add(model));
 }