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

            if (rowsCount > 0)
            {
                JY.Model.OrderFormDetail model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new JY.Model.OrderFormDetail();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = long.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["OrderFormID"] != null && dt.Rows[n]["OrderFormID"].ToString() != "")
                    {
                        model.OrderFormID = long.Parse(dt.Rows[n]["OrderFormID"].ToString());
                    }
                    if (dt.Rows[n]["OrderFormNo"] != null && dt.Rows[n]["OrderFormNo"].ToString() != "")
                    {
                        model.OrderFormNo = dt.Rows[n]["OrderFormNo"].ToString();
                    }
                    if (dt.Rows[n]["ProductID"] != null && dt.Rows[n]["ProductID"].ToString() != "")
                    {
                        model.ProductID = int.Parse(dt.Rows[n]["ProductID"].ToString());
                    }
                    if (dt.Rows[n]["ProductNo"] != null && dt.Rows[n]["ProductNo"].ToString() != "")
                    {
                        model.ProductNo = dt.Rows[n]["ProductNo"].ToString();
                    }
                    if (dt.Rows[n]["ProductName"] != null && dt.Rows[n]["ProductName"].ToString() != "")
                    {
                        model.ProductName = dt.Rows[n]["ProductName"].ToString();
                    }
                    if (dt.Rows[n]["Spec"] != null && dt.Rows[n]["Spec"].ToString() != "")
                    {
                        model.Spec = dt.Rows[n]["Spec"].ToString();
                    }
                    if (dt.Rows[n]["Price"] != null && dt.Rows[n]["Price"].ToString() != "")
                    {
                        model.Price = decimal.Parse(dt.Rows[n]["Price"].ToString());
                    }
                    if (dt.Rows[n]["Number"] != null && dt.Rows[n]["Number"].ToString() != "")
                    {
                        model.Number = int.Parse(dt.Rows[n]["Number"].ToString());
                    }
                    if (dt.Rows[n]["WebsitePrice"] != null && dt.Rows[n]["WebsitePrice"].ToString() != "")
                    {
                        model.WebsitePrice = decimal.Parse(dt.Rows[n]["WebsitePrice"].ToString());
                    }
                    if (dt.Rows[n]["TotalPrice"] != null && dt.Rows[n]["TotalPrice"].ToString() != "")
                    {
                        model.TotalPrice = decimal.Parse(dt.Rows[n]["TotalPrice"].ToString());
                    }
                    if (dt.Rows[n]["IsDelete"] != null && dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        if ((dt.Rows[n]["IsDelete"].ToString() == "1") || (dt.Rows[n]["IsDelete"].ToString().ToLower() == "true"))
                        {
                            model.IsDelete = true;
                        }
                        else
                        {
                            model.IsDelete = false;
                        }
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }