Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <lgk.Model.gp_globeParam> DataTableToList(DataTable dt)
        {
            List <lgk.Model.gp_globeParam> modelList = new List <lgk.Model.gp_globeParam>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                lgk.Model.gp_globeParam model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new lgk.Model.gp_globeParam();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = long.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    model.ParamName = dt.Rows[n]["ParamName"].ToString();
                    if (dt.Rows[n]["ParamAmount"].ToString() != "")
                    {
                        model.ParamAmount = decimal.Parse(dt.Rows[n]["ParamAmount"].ToString());
                    }
                    if (dt.Rows[n]["ParamInt"].ToString() != "")
                    {
                        model.ParamInt = int.Parse(dt.Rows[n]["ParamInt"].ToString());
                    }
                    model.ParamVarchar = dt.Rows[n]["ParamVarchar"].ToString();
                    model.Remark       = dt.Rows[n]["Remark"].ToString();
                    if (dt.Rows[n]["ParamType"].ToString() != "")
                    {
                        model.ParamType = int.Parse(dt.Rows[n]["ParamType"].ToString());
                    }
                    model.EndRemark = dt.Rows[n]["EndRemark"].ToString();
                    if (dt.Rows[n]["IsEdit"].ToString() != "")
                    {
                        model.IsEdit = int.Parse(dt.Rows[n]["IsEdit"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(lgk.Model.gp_globeParam model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public long Add(lgk.Model.gp_globeParam model)
 {
     return(dal.Add(model));
 }