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

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.MemDrawMoney model = new Chain.Model.MemDrawMoney();
                    if (dt.Rows[i]["DrawMoneyID"] != null && dt.Rows[i]["DrawMoneyID"].ToString() != "")
                    {
                        model.DrawMoneyID = int.Parse(dt.Rows[i]["DrawMoneyID"].ToString());
                    }
                    if (dt.Rows[i]["DrawMoneyMemID"] != null && dt.Rows[i]["DrawMoneyMemID"].ToString() != "")
                    {
                        model.DrawMoneyMemID = int.Parse(dt.Rows[i]["DrawMoneyMemID"].ToString());
                    }
                    if (dt.Rows[i]["DrawMoneyAccount"] != null && dt.Rows[i]["DrawMoneyAccount"].ToString() != "")
                    {
                        model.DrawMoneyAccount = dt.Rows[i]["DrawMoneyAccount"].ToString();
                    }
                    if (dt.Rows[i]["DrawMoney"] != null && dt.Rows[i]["DrawMoney"].ToString() != "")
                    {
                        model.DrawMoney = decimal.Parse(dt.Rows[i]["DrawMoney"].ToString());
                    }
                    if (dt.Rows[i]["DrawActualMoney"] != null && dt.Rows[i]["DrawActualMoney"].ToString() != "")
                    {
                        model.DrawActualMoney = decimal.Parse(dt.Rows[i]["DrawActualMoney"].ToString());
                    }
                    if (dt.Rows[i]["DrawMoneyRemark"] != null && dt.Rows[i]["DrawMoneyRemark"].ToString() != "")
                    {
                        model.DrawMoneyRemark = dt.Rows[i]["DrawMoneyRemark"].ToString();
                    }
                    if (dt.Rows[i]["DrawMoneyShopID"] != null && dt.Rows[i]["DrawMoneyShopID"].ToString() != "")
                    {
                        model.DrawMoneyShopID = int.Parse(dt.Rows[i]["DrawMoneyShopID"].ToString());
                    }
                    if (dt.Rows[i]["DrawMoneyUserID"] != null && dt.Rows[i]["DrawMoneyUserID"].ToString() != "")
                    {
                        model.DrawMoneyUserID = int.Parse(dt.Rows[i]["DrawMoneyUserID"].ToString());
                    }
                    if (dt.Rows[i]["DrawMoneyCreateTime"] != null && dt.Rows[i]["DrawMoneyCreateTime"].ToString() != "")
                    {
                        model.DrawMoneyCreateTime = DateTime.Parse(dt.Rows[i]["DrawMoneyCreateTime"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 public bool Update(Chain.Model.MemDrawMoney model)
 {
     return(this.dal.Update(model));
 }
Esempio n. 3
0
 public int Add(Chain.Model.MemDrawMoney model)
 {
     return(this.dal.Add(model));
 }