Exemple #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_FixedAssetsLossTableDetail> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_FixedAssetsLossTableDetail> modelList = new List <MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_FixedAssetsLossTableDetail>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_FixedAssetsLossTableDetail model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_FixedAssetsLossTableDetail();
                    if (dt.Rows[n]["InfoID"].ToString() != "")
                    {
                        model.InfoID = int.Parse(dt.Rows[n]["InfoID"].ToString());
                    }
                    if (dt.Rows[n]["FixedAssetsLossTableID"].ToString() != "")
                    {
                        model.FixedAssetsLossTableID = int.Parse(dt.Rows[n]["FixedAssetsLossTableID"].ToString());
                    }
                    model.PName = dt.Rows[n]["PName"].ToString();
                    model.Model = dt.Rows[n]["Model"].ToString();
                    model.Unit  = dt.Rows[n]["Unit"].ToString();
                    if (dt.Rows[n]["Price"].ToString() != "")
                    {
                        model.Price = decimal.Parse(dt.Rows[n]["Price"].ToString());
                    }
                    if (dt.Rows[n]["Quantity"].ToString() != "")
                    {
                        model.Quantity = int.Parse(dt.Rows[n]["Quantity"].ToString());
                    }
                    if (dt.Rows[n]["OriginalValue"].ToString() != "")
                    {
                        model.OriginalValue = decimal.Parse(dt.Rows[n]["OriginalValue"].ToString());
                    }
                    if (dt.Rows[n]["NetWorth"].ToString() != "")
                    {
                        model.NetWorth = decimal.Parse(dt.Rows[n]["NetWorth"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_FixedAssetsLossTableDetail model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_FixedAssetsLossTableDetail model)
 {
     return(dal.Add(model));
 }