예제 #1
0
파일: Settings.cs 프로젝트: tangaoxiang/ERM
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ERM.MDL.Settings> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <ERM.MDL.Settings> modelList = new List <ERM.MDL.Settings>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                ERM.MDL.Settings model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new ERM.MDL.Settings();
                    model.AppTitle = ds.Tables[0].Rows[n]["AppTitle"].ToString();
                    if (ds.Tables[0].Rows[n]["defaultTempID"].ToString() != "")
                    {
                        model.defaultTempID = int.Parse(ds.Tables[0].Rows[n]["defaultTempID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(ds.Tables[0].Rows[n]["ID"].ToString());
                    }
                    model.port        = ds.Tables[0].Rows[n]["port"].ToString();
                    model.PromptTitle = ds.Tables[0].Rows[n]["PromptTitle"].ToString();
                    model.ServerAddr  = ds.Tables[0].Rows[n]["ServerAddr"].ToString();
                    if (ds.Tables[0].Rows[n]["timeout"].ToString() != "")
                    {
                        model.timeout = int.Parse(ds.Tables[0].Rows[n]["timeout"].ToString());
                    }
                    model.UserTitle = ds.Tables[0].Rows[n]["UserTitle"].ToString();
                    model.Ver       = ds.Tables[0].Rows[n]["Ver"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
파일: Settings.cs 프로젝트: tangaoxiang/ERM
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ERM.MDL.Settings model)
 {
     dal.Update(model);
 }
예제 #3
0
파일: Settings.cs 프로젝트: tangaoxiang/ERM
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(ERM.MDL.Settings model)
 {
     dal.Add(model);
 }