Exemplo n.º 1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Hownet.Model.DepartmentDemand model)
 {
     dal.Update(model);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Hownet.Model.DepartmentDemand> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <Hownet.Model.DepartmentDemand> modelList = new List <Hownet.Model.DepartmentDemand>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                Hownet.Model.DepartmentDemand model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.DepartmentDemand();
                    if (ds.Tables[0].Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(ds.Tables[0].Rows[n]["ID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["DepID"].ToString() != "")
                    {
                        model.DepID = int.Parse(ds.Tables[0].Rows[n]["DepID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["ColorOneID"].ToString() != "")
                    {
                        model.ColorOneID = int.Parse(ds.Tables[0].Rows[n]["ColorOneID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["DepartmentTaskID"].ToString() != "")
                    {
                        model.DepartmentTaskID = int.Parse(ds.Tables[0].Rows[n]["DepartmentTaskID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["MaterielID"].ToString() != "")
                    {
                        model.MaterielID = int.Parse(ds.Tables[0].Rows[n]["MaterielID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["ColorID"].ToString() != "")
                    {
                        model.ColorID = int.Parse(ds.Tables[0].Rows[n]["ColorID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["ColorTwoID"].ToString() != "")
                    {
                        model.ColorTwoID = int.Parse(ds.Tables[0].Rows[n]["ColorTwoID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Amount"].ToString() != "")
                    {
                        model.Amount = decimal.Parse(ds.Tables[0].Rows[n]["Amount"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["NotAmount"].ToString() != "")
                    {
                        model.NotAmount = decimal.Parse(ds.Tables[0].Rows[n]["NotAmount"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["SizeID"].ToString() != "")
                    {
                        model.SizeID = int.Parse(ds.Tables[0].Rows[n]["SizeID"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["MeasureID"].ToString() != "")
                    {
                        model.MeasureID = int.Parse(ds.Tables[0].Rows[n]["MeasureID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hownet.Model.DepartmentDemand model)
 {
     return(dal.Add(model));
 }