示例#1
0
        public List <Chain.Model.PointDraw> DataTableToList(DataTable dt)
        {
            List <Chain.Model.PointDraw> modelList = new List <Chain.Model.PointDraw>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.PointDraw model = new Chain.Model.PointDraw();
                    if (dt.Rows[i]["DrawID"] != null && dt.Rows[i]["DrawID"].ToString() != "")
                    {
                        model.DrawID = int.Parse(dt.Rows[i]["DrawID"].ToString());
                    }
                    if (dt.Rows[i]["DrawShopID"] != null && dt.Rows[i]["DrawShopID"].ToString() != "")
                    {
                        model.DrawShopID = int.Parse(dt.Rows[i]["DrawShopID"].ToString());
                    }
                    if (dt.Rows[i]["DrawPoint"] != null && dt.Rows[i]["DrawPoint"].ToString() != "")
                    {
                        model.DrawPoint = int.Parse(dt.Rows[i]["DrawPoint"].ToString());
                    }
                    if (dt.Rows[i]["DrawAmount"] != null && dt.Rows[i]["DrawAmount"].ToString() != "")
                    {
                        model.DrawAmount = int.Parse(dt.Rows[i]["DrawAmount"].ToString());
                    }
                    if (dt.Rows[i]["DrawStatus"] != null && dt.Rows[i]["DrawStatus"].ToString() != "")
                    {
                        model.DrawStatus = int.Parse(dt.Rows[i]["DrawStatus"].ToString());
                    }
                    if (dt.Rows[i]["DrawCreateTime"] != null && dt.Rows[i]["DrawCreateTime"].ToString() != "")
                    {
                        model.DrawCreateTime = DateTime.Parse(dt.Rows[i]["DrawCreateTime"].ToString());
                    }
                    if (dt.Rows[i]["DrawCreateUserID"] != null && dt.Rows[i]["DrawCreateUserID"].ToString() != "")
                    {
                        model.DrawCreateUserID = int.Parse(dt.Rows[i]["DrawCreateUserID"].ToString());
                    }
                    if (dt.Rows[i]["DrawVerifyTime"] != null && dt.Rows[i]["DrawVerifyTime"].ToString() != "")
                    {
                        model.DrawVerifyTime = DateTime.Parse(dt.Rows[i]["DrawVerifyTime"].ToString());
                    }
                    if (dt.Rows[i]["DrawVerifyUserID"] != null && dt.Rows[i]["DrawVerifyUserID"].ToString() != "")
                    {
                        model.DrawVerifyUserID = int.Parse(dt.Rows[i]["DrawVerifyUserID"].ToString());
                    }
                    model.DrawRemark = dt.Rows[i]["DrawRemark"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 public bool Update(Chain.Model.PointDraw model)
 {
     return(this.dal.Update(model));
 }
示例#3
0
 public int Add(Chain.Model.PointDraw model)
 {
     return(this.dal.Add(model));
 }