Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <lgk.Model.tb_StockIssue> DataTableToList(DataTable dt)
        {
            List <lgk.Model.tb_StockIssue> modelList = new List <lgk.Model.tb_StockIssue>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                lgk.Model.tb_StockIssue model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new lgk.Model.tb_StockIssue();
                    if (dt.Rows[n]["IssueID"] != null && dt.Rows[n]["IssueID"].ToString() != "")
                    {
                        model.IssueID = int.Parse(dt.Rows[n]["IssueID"].ToString());
                    }
                    if (dt.Rows[n]["IssueAmount"] != null && dt.Rows[n]["IssueAmount"].ToString() != "")
                    {
                        model.IssueAmount = decimal.Parse(dt.Rows[n]["IssueAmount"].ToString());
                    }
                    if (dt.Rows[n]["SurplusAmount"] != null && dt.Rows[n]["SurplusAmount"].ToString() != "")
                    {
                        model.SurplusAmount = decimal.Parse(dt.Rows[n]["SurplusAmount"].ToString());
                    }
                    if (dt.Rows[n]["AddDate"] != null && dt.Rows[n]["AddDate"].ToString() != "")
                    {
                        model.AddDate = DateTime.Parse(dt.Rows[n]["AddDate"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(lgk.Model.tb_StockIssue model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(lgk.Model.tb_StockIssue model)
 {
     return(dal.Add(model));
 }