Пример #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public decimal Add(Maticsoft.Model.FixtureList model)
 {
     return(dal.Add(model));
 }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.FixtureList model)
 {
     return(dal.Update(model));
 }
Пример #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public ObservableCollection <Maticsoft.Model.FixtureList> DataTableToList1(DataTable dt)
        {
            ObservableCollection <Maticsoft.Model.FixtureList> modelList = new ObservableCollection <Maticsoft.Model.FixtureList>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Maticsoft.Model.FixtureList model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.FixtureList();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = decimal.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["BarCode"] != null && dt.Rows[n]["BarCode"].ToString() != "")
                    {
                        model.BarCode = dt.Rows[n]["BarCode"].ToString();
                    }
                    if (dt.Rows[n]["Fixture_Name"] != null && dt.Rows[n]["Fixture_Name"].ToString() != "")
                    {
                        model.Fixture_Name = dt.Rows[n]["Fixture_Name"].ToString();
                    }
                    if (dt.Rows[n]["InstallLocation"] != null && dt.Rows[n]["InstallLocation"].ToString() != "")
                    {
                        model.InstallLocation = dt.Rows[n]["InstallLocation"].ToString();
                    }
                    if (dt.Rows[n]["F_State"] != null && dt.Rows[n]["F_State"].ToString() != "")
                    {
                        model.F_State = dt.Rows[n]["F_State"].ToString();
                    }
                    if (dt.Rows[n]["LogDate"] != null && dt.Rows[n]["LogDate"].ToString() != "")
                    {
                        model.LogDate = DateTime.Parse(dt.Rows[n]["LogDate"].ToString());
                    }
                    if (dt.Rows[n]["LogUser"] != null && dt.Rows[n]["LogUser"].ToString() != "")
                    {
                        model.LogUser = dt.Rows[n]["LogUser"].ToString();
                    }
                    if (dt.Rows[n]["CareUser"] != null && dt.Rows[n]["CareUser"].ToString() != "")
                    {
                        model.CareUser = dt.Rows[n]["CareUser"].ToString();
                    }
                    if (dt.Rows[n]["UseDate"] != null && dt.Rows[n]["UseDate"].ToString() != "")
                    {
                        model.UseDate = DateTime.Parse(dt.Rows[n]["UseDate"].ToString());
                    }
                    if (dt.Rows[n]["ScrapDate"] != null && dt.Rows[n]["ScrapDate"].ToString() != "")
                    {
                        model.ScrapDate = DateTime.Parse(dt.Rows[n]["ScrapDate"].ToString());
                    }
                    if (dt.Rows[n]["FAY_ID"] != null && dt.Rows[n]["FAY_ID"].ToString() != "")
                    {
                        model.FAY_ID = dt.Rows[n]["FAY_ID"].ToString();
                    }
                    if (dt.Rows[n]["Remark"] != null && dt.Rows[n]["Remark"].ToString() != "")
                    {
                        model.Remark = dt.Rows[n]["Remark"].ToString();
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }