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

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