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

            if (rowsCount > 0)
            {
                LPWeb.Model.Template_RuleConditions model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.Template_RuleConditions();
                    if (dt.Rows[n]["RuleCondId"].ToString() != "")
                    {
                        model.RuleCondId = int.Parse(dt.Rows[n]["RuleCondId"].ToString());
                    }
                    if (dt.Rows[n]["RuleId"].ToString() != "")
                    {
                        model.RuleId = int.Parse(dt.Rows[n]["RuleId"].ToString());
                    }
                    if (dt.Rows[n]["PointFieldId"].ToString() != "")
                    {
                        model.PointFieldId = decimal.Parse(dt.Rows[n]["PointFieldId"].ToString());
                    }
                    if (dt.Rows[n]["Condition"].ToString() != "")
                    {
                        model.Condition = int.Parse(dt.Rows[n]["Condition"].ToString());
                    }
                    model.Tolerance     = dt.Rows[n]["Tolerance"].ToString();
                    model.ToleranceType = dt.Rows[n]["ToleranceType"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.Template_RuleConditions model)
 {
     dal.Update(model);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(LPWeb.Model.Template_RuleConditions model)
 {
     return(dal.Add(model));
 }