Ejemplo n.º 1
0
        public List <Chain.Model.GoodsLogDetail> DataTableToList(DataTable dt)
        {
            List <Chain.Model.GoodsLogDetail> modelList = new List <Chain.Model.GoodsLogDetail>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.GoodsLogDetail model = new Chain.Model.GoodsLogDetail();
                    if (dt.Rows[i]["GoodsLogDetailID"] != null && dt.Rows[i]["GoodsLogDetailID"].ToString() != "")
                    {
                        model.GoodsLogDetailID = int.Parse(dt.Rows[i]["GoodsLogDetailID"].ToString());
                    }
                    if (dt.Rows[i]["GoodsLogID"] != null && dt.Rows[i]["GoodsLogID"].ToString() != "")
                    {
                        model.GoodsLogID = int.Parse(dt.Rows[i]["GoodsLogID"].ToString());
                    }
                    if (dt.Rows[i]["GoodsID"] != null && dt.Rows[i]["GoodsID"].ToString() != "")
                    {
                        model.GoodsID = int.Parse(dt.Rows[i]["GoodsID"].ToString());
                    }
                    if (dt.Rows[i]["GoodsInPrice"] != null && dt.Rows[i]["GoodsInPrice"].ToString() != "")
                    {
                        model.GoodsInPrice = decimal.Parse(dt.Rows[i]["GoodsInPrice"].ToString());
                    }
                    if (dt.Rows[i]["GoodsOutPrice"] != null && dt.Rows[i]["GoodsOutPrice"].ToString() != "")
                    {
                        model.GoodsOutPrice = decimal.Parse(dt.Rows[i]["GoodsOutPrice"].ToString());
                    }
                    if (dt.Rows[i]["GoodsNumber"] != null && dt.Rows[i]["GoodsNumber"].ToString() != "")
                    {
                        model.GoodsNumber = decimal.Parse(dt.Rows[i]["GoodsNumber"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 public bool Update(Chain.Model.GoodsLogDetail model)
 {
     return(this.dal.Update(model));
 }
Ejemplo n.º 3
0
 public int Add(Chain.Model.GoodsLogDetail model)
 {
     return(this.dal.Add(model));
 }