示例#1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.ReceivedMoney model)
 {
     return(dal.Update(model));
 }
示例#2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(DTcms.Model.ReceivedMoney model)
 {
     dal.Add(model);
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(DTcms.Model.ReceivedMoney model)
 {
     return(dal.Add(model));
 }
示例#4
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DTcms.Model.ReceivedMoney> DataTableToList(DataTable dt)
        {
            List <DTcms.Model.ReceivedMoney> modelList = new List <DTcms.Model.ReceivedMoney>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DTcms.Model.ReceivedMoney model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.ReceivedMoney();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["StoreInOrderId"].ToString() != "")
                    {
                        model.StoreInOrderId = int.Parse(dt.Rows[n]["StoreInOrderId"].ToString());
                    }
                    if (dt.Rows[n]["CustomerId"].ToString() != "")
                    {
                        model.CustomerId = int.Parse(dt.Rows[n]["CustomerId"].ToString());
                    }
                    model.Name = dt.Rows[n]["Name"].ToString();
                    if (dt.Rows[n]["BeginChargingTime"].ToString() != "")
                    {
                        model.BeginChargingTime = DateTime.Parse(dt.Rows[n]["BeginChargingTime"].ToString());
                    }
                    if (dt.Rows[n]["EndChargingTime2"].ToString() != "")
                    {
                        model.EndChargingTime2 = DateTime.Parse(dt.Rows[n]["EndChargingTime2"].ToString());
                    }
                    if (dt.Rows[n]["ChargingCount"].ToString() != "")
                    {
                        model.ChargingCount = decimal.Parse(dt.Rows[n]["ChargingCount"].ToString());
                    }
                    if (dt.Rows[n]["TotalPrice"].ToString() != "")
                    {
                        model.TotalPrice = decimal.Parse(dt.Rows[n]["TotalPrice"].ToString());
                    }
                    if (dt.Rows[n]["FactTotalPrice"].ToString() != "")
                    {
                        model.FactTotalPrice = decimal.Parse(dt.Rows[n]["FactTotalPrice"].ToString());
                    }
                    if (dt.Rows[n]["CreateTime"].ToString() != "")
                    {
                        model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString());
                    }
                    model.Admin  = dt.Rows[n]["Admin"].ToString();
                    model.Remark = dt.Rows[n]["Remark"].ToString();
                    if (dt.Rows[n]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(dt.Rows[n]["Status"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }