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

            if (rowsCount > 0)
            {
                ROYcms.Sys.Model.ROYcms_Goods_Order_Detail model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new ROYcms.Sys.Model.ROYcms_Goods_Order_Detail();
                    if (dt.Rows[n]["Id"] != null && dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["order_id"] != null && dt.Rows[n]["order_id"].ToString() != "")
                    {
                        model.order_id = dt.Rows[n]["order_id"].ToString();
                    }
                    if (dt.Rows[n]["goods_id"] != null && dt.Rows[n]["goods_id"].ToString() != "")
                    {
                        model.goods_id = int.Parse(dt.Rows[n]["goods_id"].ToString());
                    }
                    if (dt.Rows[n]["goods_name"] != null && dt.Rows[n]["goods_name"].ToString() != "")
                    {
                        model.goods_name = dt.Rows[n]["goods_name"].ToString();
                    }
                    if (dt.Rows[n]["goods_sn"] != null && dt.Rows[n]["goods_sn"].ToString() != "")
                    {
                        model.goods_sn = dt.Rows[n]["goods_sn"].ToString();
                    }
                    if (dt.Rows[n]["goods_number"] != null && dt.Rows[n]["goods_number"].ToString() != "")
                    {
                        model.goods_number = int.Parse(dt.Rows[n]["goods_number"].ToString());
                    }
                    if (dt.Rows[n]["market_price"] != null && dt.Rows[n]["market_price"].ToString() != "")
                    {
                        model.market_price = int.Parse(dt.Rows[n]["market_price"].ToString());
                    }
                    if (dt.Rows[n]["goods_price"] != null && dt.Rows[n]["goods_price"].ToString() != "")
                    {
                        model.goods_price = int.Parse(dt.Rows[n]["goods_price"].ToString());
                    }
                    if (dt.Rows[n]["goods_attr"] != null && dt.Rows[n]["goods_attr"].ToString() != "")
                    {
                        model.goods_attr = dt.Rows[n]["goods_attr"].ToString();
                    }
                    if (dt.Rows[n]["send_number"] != null && dt.Rows[n]["send_number"].ToString() != "")
                    {
                        model.send_number = int.Parse(dt.Rows[n]["send_number"].ToString());
                    }
                    if (dt.Rows[n]["is_real"] != null && dt.Rows[n]["is_real"].ToString() != "")
                    {
                        model.is_real = int.Parse(dt.Rows[n]["is_real"].ToString());
                    }
                    if (dt.Rows[n]["extension_code"] != null && dt.Rows[n]["extension_code"].ToString() != "")
                    {
                        model.extension_code = dt.Rows[n]["extension_code"].ToString();
                    }
                    if (dt.Rows[n]["parent_id"] != null && dt.Rows[n]["parent_id"].ToString() != "")
                    {
                        model.parent_id = int.Parse(dt.Rows[n]["parent_id"].ToString());
                    }
                    if (dt.Rows[n]["is_gift"] != null && dt.Rows[n]["is_gift"].ToString() != "")
                    {
                        model.is_gift = int.Parse(dt.Rows[n]["is_gift"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }