예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ERM.MDL.PageSize> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <ERM.MDL.PageSize> modelList = new List <ERM.MDL.PageSize>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                ERM.MDL.PageSize model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ERM.MDL.PageSize();
                    if (ds.Tables[0].Rows[n]["IsDefault"].ToString() != "")
                    {
                        model.IsDefault = int.Parse(ds.Tables[0].Rows[n]["IsDefault"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Pages"].ToString() != "")
                    {
                        model.Pages = int.Parse(ds.Tables[0].Rows[n]["Pages"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Pfloat"].ToString() != "")
                    {
                        model.Pfloat = int.Parse(ds.Tables[0].Rows[n]["Pfloat"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["PID"].ToString() != "")
                    {
                        model.PID = int.Parse(ds.Tables[0].Rows[n]["PID"].ToString());
                    }
                    model.PTYPE = ds.Tables[0].Rows[n]["PTYPE"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
파일: PageSize.cs 프로젝트: tangaoxiang/ERM
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(ERM.MDL.PageSize model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update PageSize set ");
            strSql.Append("IsDefault=" + model.IsDefault + ",");
            strSql.Append("Pages=" + model.Pages + ",");
            strSql.Append("Pfloat=" + model.Pfloat + ",");
            strSql.Append("PTYPE='" + model.PTYPE + "'");
            strSql.Append(" where PID=" + model.PID + " ");
            DbHelperOleDb.ExecuteSql(strSql.ToString());
        }
예제 #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(ERM.MDL.PageSize model)
 {
     dal.Update(model);
 }
예제 #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(ERM.MDL.PageSize model)
 {
     dal.Add(model);
 }