예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <ZhangWei.Model.Dept_Supplier> DataTableToList(DataTable dt)
        {
            List <ZhangWei.Model.Dept_Supplier> modelList = new List <ZhangWei.Model.Dept_Supplier>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                ZhangWei.Model.Dept_Supplier model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ZhangWei.Model.Dept_Supplier();
                    if (dt.Rows[n]["Dept_ID"] != null && dt.Rows[n]["Dept_ID"].ToString() != "")
                    {
                        model.Dept_ID = int.Parse(dt.Rows[n]["Dept_ID"].ToString());
                    }
                    if (dt.Rows[n]["Supplier_ID"] != null && dt.Rows[n]["Supplier_ID"].ToString() != "")
                    {
                        model.Supplier_ID = int.Parse(dt.Rows[n]["Supplier_ID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(ZhangWei.Model.Dept_Supplier model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(ZhangWei.Model.Dept_Supplier model)
 {
     return(dal.Add(model));
 }