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

            if (rowsCount > 0)
            {
                university.Model.CCOM.User_extra model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new university.Model.CCOM.User_extra();
                    if (dt.Rows[n]["Ue_id"].ToString() != "")
                    {
                        model.Ue_id = int.Parse(dt.Rows[n]["Ue_id"].ToString());
                    }
                    model.Ue_name = dt.Rows[n]["Ue_name"].ToString();
                    if (dt.Rows[n]["Ue_type"].ToString() != "")
                    {
                        model.Ue_type = int.Parse(dt.Rows[n]["Ue_type"].ToString());
                    }
                    if (dt.Rows[n]["Ue_null"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Ue_null"].ToString() == "1") || (dt.Rows[n]["Ue_null"].ToString().ToLower() == "true"))
                        {
                            model.Ue_null = true;
                        }
                        else
                        {
                            model.Ue_null = false;
                        }
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(university.Model.CCOM.User_extra model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(university.Model.CCOM.User_extra model)
 {
     return(dal.Add(model));
 }