예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Maticsoft.Model.WMS_CL> DataTableToList(DataTable dt)
        {
            List <Maticsoft.Model.WMS_CL> modelList = new List <Maticsoft.Model.WMS_CL>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Maticsoft.Model.WMS_CL model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model    = new Maticsoft.Model.WMS_CL();
                    model.ID = dt.Rows[n]["ID"].ToString();
                    if (dt.Rows[n]["RQ"].ToString() != "")
                    {
                        model.RQ = DateTime.Parse(dt.Rows[n]["RQ"].ToString());
                    }
                    model.DW     = dt.Rows[n]["DW"].ToString();
                    model.REMARK = dt.Rows[n]["REMARK"].ToString();
                    if (dt.Rows[n]["SL3"].ToString() != "")
                    {
                        model.SL3 = decimal.Parse(dt.Rows[n]["SL3"].ToString());
                    }
                    model.CLTYPE = dt.Rows[n]["CLTYPE"].ToString();
                    model.CLBH   = dt.Rows[n]["CLBH"].ToString();
                    model.CLMC   = dt.Rows[n]["CLMC"].ToString();
                    model.SGBH   = dt.Rows[n]["SGBH"].ToString();
                    model.CW     = dt.Rows[n]["CW"].ToString();
                    if (dt.Rows[n]["SL1"].ToString() != "")
                    {
                        model.SL1 = decimal.Parse(dt.Rows[n]["SL1"].ToString());
                    }
                    if (dt.Rows[n]["SL2"].ToString() != "")
                    {
                        model.SL2 = decimal.Parse(dt.Rows[n]["SL2"].ToString());
                    }
                    if (dt.Rows[n]["ZDRQ"].ToString() != "")
                    {
                        model.ZDRQ = DateTime.Parse(dt.Rows[n]["ZDRQ"].ToString());
                    }


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.WMS_CL model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Maticsoft.Model.WMS_CL model)
 {
     dal.Add(model);
 }