} //parts Insert public string Insert(Model.Warehouse warehouse) { string sqlStr = "insert into Warehouse(houseID,name,position,size) values(@houseID,@name,@position,@size)"; SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@houseID", warehouse.HouseID), new SqlParameter("@name", warehouse.Name), new SqlParameter("@position", warehouse.Position), new SqlParameter("@size", warehouse.Size) }; if (userDao.Insert(sqlStr, paras)) { return("Success"); } else { return("Fail"); } } //warehouse Insert
} //parts Edit public string Edit(Model.Warehouse warehouse) { string sqlStr = "update Warehouse set name=@name,position=@position,size=@size,storageInfo=@info Where houseID=@houseID"; SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@houseID", warehouse.HouseID), new SqlParameter("@name", warehouse.Name), new SqlParameter("@position", warehouse.Position), new SqlParameter("@size", warehouse.Size), new SqlParameter("@info", warehouse.Info) }; if (userDao.Edit(sqlStr, paras)) { return("Success"); } else { return("Fail"); } } //warehouse Edit
private void MoveBox(Box theBox, Point direction, Warehouse wharehouse) { theBox.ProcessMove(direction, wharehouse); }