Exemple #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hownet.Model.SizeBow model)
 {
     return(dal.Add(model));
 }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Hownet.Model.SizeBow model)
 {
     dal.Update(model);
 }
Exemple #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Hownet.Model.SizeBow> DataTableToList(DataTable dt)
        {
            List <Hownet.Model.SizeBow> modelList = new List <Hownet.Model.SizeBow>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Hownet.Model.SizeBow model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.SizeBow();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    else
                    {
                        model.ID = 0;
                    }
                    if (dt.Rows[n]["SizeID"].ToString() != "")
                    {
                        model.SizeID = int.Parse(dt.Rows[n]["SizeID"].ToString());
                    }
                    else
                    {
                        model.SizeID = 0;
                    }
                    if (dt.Rows[n]["BowID"].ToString() != "")
                    {
                        model.BowID = int.Parse(dt.Rows[n]["BowID"].ToString());
                    }
                    else
                    {
                        model.BowID = 0;
                    }
                    if (dt.Rows[n]["CottonID"].ToString() != "")
                    {
                        model.CottonID = int.Parse(dt.Rows[n]["CottonID"].ToString());
                    }
                    else
                    {
                        model.CottonID = 0;
                    }
                    if (dt.Rows[n]["TaskID"].ToString() != "")
                    {
                        model.TaskID = int.Parse(dt.Rows[n]["TaskID"].ToString());
                    }
                    else
                    {
                        model.TaskID = 0;
                    }
                    if (dt.Rows[n]["Sash"].ToString() != "")
                    {
                        model.Sash = int.Parse(dt.Rows[n]["Sash"].ToString());
                    }
                    else
                    {
                        model.Sash = 0;
                    }
                    if (dt.Rows[n]["OpenSash"].ToString() != "")
                    {
                        model.OpenSash = int.Parse(dt.Rows[n]["OpenSash"].ToString());
                    }
                    else
                    {
                        model.OpenSash = 0;
                    }
                    if (dt.Rows[n]["PlasticBone"].ToString() != "")
                    {
                        model.PlasticBone = int.Parse(dt.Rows[n]["PlasticBone"].ToString());
                    }
                    else
                    {
                        model.PlasticBone = 0;
                    }
                    model.Remark = dt.Rows[n]["Remark"].ToString();
                    model.A      = int.Parse(dt.Rows[n]["A"].ToString());
                    modelList.Add(model);
                }
            }
            return(modelList);
        }